{
  "openapi": "3.0.1",
  "info": {
    "title": "Flexprice API",
    "description": "Flexprice API Service",
    "contact": {
      "name": "API Support"
    },
    "license": {
      "name": "AGPL-3.0",
      "url": "https://www.gnu.org/licenses/agpl-3.0.html"
    },
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://us.api.flexprice.io/v1",
      "description": "US Region"
    },
    {
      "url": "https://api.cloud.flexprice.io/v1",
      "description": "India Region"
    }
  ],
  "paths": {
    "/addons": {
      "post": {
        "tags": [
          "Addons"
        ],
        "summary": "Create addon",
        "description": "Use when defining an optional purchasable item (e.g. extra storage or support tier). Ideal for add-ons that customers can attach to a subscription.",
        "operationId": "createAddon",
        "requestBody": {
          "description": "Addon Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAddonRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAddonResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "addon"
      }
    },
    "/addons/lookup/{lookup_key}": {
      "get": {
        "tags": [
          "Addons"
        ],
        "summary": "Get addon by lookup key",
        "description": "Use when resolving an addon by external id (e.g. from your product catalog). Ideal for integrations.",
        "operationId": "getAddonByLookupKey",
        "parameters": [
          {
            "name": "lookup_key",
            "in": "path",
            "description": "Addon Lookup Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddonResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/addons/search": {
      "post": {
        "tags": [
          "Addons"
        ],
        "summary": "Query addons",
        "description": "Use when listing or searching addons (e.g. catalog or subscription builder). Returns a paginated list; supports filtering and sorting.",
        "operationId": "queryAddon",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.AddonFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAddonsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/addons/{id}": {
      "get": {
        "tags": [
          "Addons"
        ],
        "summary": "Get addon",
        "description": "Use when you need to load a single addon (e.g. for display or to attach to a subscription).",
        "operationId": "getAddon",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Addon ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddonResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Addons"
        ],
        "summary": "Update addon",
        "description": "Use when changing addon details (e.g. name, pricing, or metadata).",
        "operationId": "updateAddon",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Addon ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Update Addon Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAddonRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddonResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "addon"
      },
      "delete": {
        "tags": [
          "Addons"
        ],
        "summary": "Delete addon",
        "description": "Use when retiring an addon (e.g. end-of-life). Returns 200 with success message.",
        "operationId": "deleteAddon",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Addon ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/addons/{id}/creditgrants": {
      "get": {
        "tags": [
          "Credit Grants"
        ],
        "summary": "Get addon credit grants",
        "description": "Use when listing credits attached to an addon (e.g. included prepaid or promo credits).",
        "operationId": "getAddonCreditGrants",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Addon ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCreditGrantsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/addons/{id}/entitlements": {
      "get": {
        "tags": [
          "Entitlements"
        ],
        "summary": "Get addon entitlements",
        "description": "Use when checking what features or limits an addon grants (e.g. for display or entitlement logic).",
        "operationId": "getAddonEntitlements",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Addon ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEntitlementsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/alerts/search": {
      "post": {
        "tags": [
          "Alerts"
        ],
        "summary": "Query alert logs",
        "description": "Use when viewing or searching alert history (e.g. support triage or customer-facing alert log). Returns a paginated list; supports filtering by type, customer, subscription.",
        "operationId": "queryAlertLog",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.AlertLogFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAlertLogsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/alerts/setting": {
      "post": {
        "tags": [
          "AlertSettings"
        ],
        "summary": "Create alert settings",
        "description": "Configure a subscription, line item, or group spend alert.",
        "operationId": "createAlertSettings",
        "requestBody": {
          "description": "Alert settings",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAlertSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "alert_settings"
      }
    },
    "/alerts/setting/search": {
      "post": {
        "tags": [
          "AlertSettings"
        ],
        "summary": "Query alert settings",
        "description": "List or search alert settings. Returns a paginated list.",
        "operationId": "queryAlertSettings",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.AlertSettingsFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAlertSettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "read",
        "x-codegen-request-body-name": "filter"
      }
    },
    "/alerts/setting/{id}": {
      "get": {
        "tags": [
          "AlertSettings"
        ],
        "summary": "Get alert settings",
        "description": "Fetch a single alert setting by id.",
        "operationId": "getAlertSettings",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Alert Settings ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "AlertSettings"
        ],
        "summary": "Update alert settings",
        "description": "Patch an alert setting's config; omitted fields keep their stored value.",
        "operationId": "updateAlertSettings",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Alert Settings ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Alert settings",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAlertSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "alert_settings"
      },
      "delete": {
        "tags": [
          "AlertSettings"
        ],
        "summary": "Delete alert settings",
        "description": "Soft delete an alert setting.",
        "operationId": "deleteAlertSettings",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Alert Settings ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {}
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/checkout/sessions": {
      "post": {
        "tags": [
          "Checkout"
        ],
        "summary": "Create checkout session",
        "operationId": "createCheckoutSession",
        "requestBody": {
          "description": "Checkout session to create",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckoutSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSessionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "session"
      }
    },
    "/checkout/sessions/{id}": {
      "get": {
        "tags": [
          "Checkout"
        ],
        "summary": "Get checkout session",
        "operationId": "getCheckoutSession",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Checkout session ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSessionResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Checkout"
        ],
        "summary": "Delete checkout session",
        "operationId": "deleteCheckoutSession",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Checkout session ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {}
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/costs": {
      "post": {
        "tags": [
          "Costs"
        ],
        "summary": "Create costsheet",
        "description": "Use when setting up a new pricing configuration (e.g. a new product or region). Costsheets group prices and define the default for the environment.",
        "operationId": "createCostsheet",
        "requestBody": {
          "description": "Costsheet configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCostsheetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created costsheet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCostsheetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "costsheet"
      }
    },
    "/costs/active": {
      "get": {
        "tags": [
          "Costs"
        ],
        "summary": "Get active costsheet",
        "description": "Use when you need the tenant's default pricing configuration (e.g. for checkout or plan display). Returns the active costsheet for the environment.",
        "operationId": "getActiveCostsheet",
        "responses": {
          "200": {
            "description": "Active costsheet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostsheetResponse"
                }
              }
            }
          },
          "404": {
            "description": "No active costsheet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/costs/analytics": {
      "post": {
        "tags": [
          "Costs"
        ],
        "summary": "Get combined revenue and cost analytics",
        "description": "Use when building dashboards or reports that need revenue vs cost, ROI, and margin over a time period (e.g. finance views or executive summaries).",
        "operationId": "getDetailedCostAnalytics",
        "requestBody": {
          "description": "Combined analytics request (start_time/end_time optional - defaults to last 7 days)",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetCostAnalyticsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDetailedCostAnalyticsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/costs/analytics-v2": {
      "post": {
        "tags": [
          "Costs"
        ],
        "summary": "Get combined revenue and cost analytics (V2)",
        "description": "Use when you need the same revenue/cost/ROI analytics but computed from the costsheet usage-tracking pipeline (e.g. for consistency with usage-based cost data).",
        "operationId": "getDetailedCostAnalyticsV2",
        "requestBody": {
          "description": "Combined analytics request (start_time/end_time optional - defaults to last 7 days)",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetCostAnalyticsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDetailedCostAnalyticsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/costs/search": {
      "post": {
        "tags": [
          "Costs"
        ],
        "summary": "Query costsheets",
        "description": "Use when listing or searching costsheets (e.g. admin catalog). Returns a paginated list; supports filtering and sorting.",
        "operationId": "queryCostsheet",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/costsheet.Filter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Paginated costsheets",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCostsheetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/costs/{id}": {
      "get": {
        "tags": [
          "Costs"
        ],
        "summary": "Get costsheet",
        "description": "Use when you need to load a single costsheet (e.g. for editing or display). Supports optional expand for related prices.",
        "operationId": "getCostsheet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Costsheet ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "Comma-separated list of fields to expand (e.g., 'prices')",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Costsheet details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCostsheetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Costsheet not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Costs"
        ],
        "summary": "Update costsheet",
        "description": "Use when changing costsheet name or metadata.",
        "operationId": "updateCostsheet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Costsheet ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Costsheet configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCostsheetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated costsheet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateCostsheetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Costsheet not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "costsheet"
      },
      "delete": {
        "tags": [
          "Costs"
        ],
        "summary": "Delete costsheet",
        "description": "Use when retiring a costsheet (e.g. end-of-life product). Soft-deletes; status set to deleted.",
        "operationId": "deleteCostsheet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Costsheet ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Costsheet deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteCostsheetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Costsheet not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/coupons": {
      "post": {
        "tags": [
          "Coupons"
        ],
        "summary": "Create coupon",
        "description": "Use when creating a discount (e.g. promo code or referral). Ideal for percent or fixed value, with optional validity and usage limits.",
        "operationId": "createCoupon",
        "requestBody": {
          "description": "Coupon request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCouponRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "coupon"
      }
    },
    "/coupons/associations": {
      "get": {
        "tags": [
          "Coupon Associations"
        ],
        "summary": "List coupon associations",
        "description": "List coupon associations with optional filters. Coupon associations are created and removed via the subscription modify API.",
        "operationId": "listCouponAssociations",
        "parameters": [
          {
            "name": "subscription_ids",
            "in": "query",
            "description": "Filter by subscription IDs (max 100)",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "coupon_ids",
            "in": "query",
            "description": "Filter by coupon IDs (max 100)",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "active_only",
            "in": "query",
            "description": "Return only currently active associations",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "Comma-separated fields: coupon, subscription_line_items, subscription_line_items.prices",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Page offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCouponAssociationsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "read"
      }
    },
    "/coupons/associations/{id}": {
      "get": {
        "tags": [
          "Coupon Associations"
        ],
        "summary": "Get coupon association",
        "description": "Get a single coupon association by ID. Coupon associations are created and removed via the subscription modify API.",
        "operationId": "getCouponAssociation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Coupon Association ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponAssociationResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "read"
      }
    },
    "/coupons/code/{code}": {
      "get": {
        "tags": [
          "Coupons"
        ],
        "summary": "Get coupon by code",
        "description": "Use when resolving a coupon by promo code (e.g. checkout or validation).",
        "operationId": "getCouponByCode",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "description": "Coupon code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "read"
      }
    },
    "/coupons/search": {
      "post": {
        "tags": [
          "Coupons"
        ],
        "summary": "Query coupons",
        "description": "Use when listing or searching coupons (e.g. promo management). Returns a paginated list; supports filtering and sorting.",
        "operationId": "queryCoupon",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.CouponFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCouponsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/coupons/{id}": {
      "get": {
        "tags": [
          "Coupons"
        ],
        "summary": "Get coupon",
        "description": "Use when you need to load a single coupon (e.g. for display or to validate a code).",
        "operationId": "getCoupon",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Coupon ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Coupons"
        ],
        "summary": "Update coupon",
        "description": "Use when changing coupon config (e.g. value, validity, or usage limits).",
        "operationId": "updateCoupon",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Coupon ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Coupon update request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCouponRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "coupon"
      },
      "delete": {
        "tags": [
          "Coupons"
        ],
        "summary": "Delete coupon",
        "description": "Use when retiring a coupon (e.g. campaign ended). Returns 200 with success message.",
        "operationId": "deleteCoupon",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Coupon ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/creditgrants": {
      "post": {
        "tags": [
          "Credit Grants"
        ],
        "summary": "Create credit grant",
        "description": "Use when giving a customer or plan credits (e.g. prepaid balance or promotional credits). Scope can be plan or subscription; supports start/end dates.",
        "operationId": "createCreditGrant",
        "requestBody": {
          "description": "Credit Grant configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCreditGrantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditGrantResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "credit_grant"
      }
    },
    "/creditgrants/{id}": {
      "get": {
        "tags": [
          "Credit Grants"
        ],
        "summary": "Get credit grant",
        "description": "Use when you need to load a single credit grant (e.g. for display or to check balance).",
        "operationId": "getCreditGrant",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Credit Grant ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditGrantResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Credit Grants"
        ],
        "summary": "Update credit grant",
        "description": "Use when changing a credit grant (e.g. amount or end date). Request body contains the fields to update.",
        "operationId": "updateCreditGrant",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Credit Grant ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Credit Grant configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCreditGrantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditGrantResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "credit_grant"
      },
      "delete": {
        "tags": [
          "Credit Grants"
        ],
        "summary": "Delete credit grant",
        "description": "Use when removing or ending a credit grant (e.g. revoke promo or close prepaid). Plan-scoped grants are archived; subscription-scoped supports optional effective_date in body.",
        "operationId": "deleteCreditGrant",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Credit Grant ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Optional: effective_date for subscription-scoped grants",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteCreditGrantRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    },
    "/creditnotes": {
      "post": {
        "tags": [
          "Credit Notes"
        ],
        "summary": "Create credit note",
        "description": "Use when issuing a refund or adjustment (e.g. customer dispute or proration). Links to an invoice; create as draft then finalize.",
        "operationId": "createCreditNote",
        "requestBody": {
          "description": "Credit note request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCreditNoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditNoteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "credit_note"
      }
    },
    "/creditnotes/{id}": {
      "get": {
        "tags": [
          "Credit Notes"
        ],
        "summary": "Get credit note",
        "description": "Use when you need to load a single credit note (e.g. for display or reconciliation).",
        "operationId": "getCreditNote",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Credit note ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditNoteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error\" \"Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/creditnotes/{id}/finalize": {
      "post": {
        "tags": [
          "Credit Notes"
        ],
        "summary": "Finalize credit note",
        "description": "Use when locking a draft credit note and applying the credit (e.g. after approval). Once finalized, applied per billing provider.",
        "operationId": "processCreditNote",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Credit note ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditNoteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/creditnotes/{id}/void": {
      "post": {
        "tags": [
          "Credit Notes"
        ],
        "summary": "Void credit note",
        "description": "Use when cancelling a draft credit note (e.g. created by mistake). Only draft credit notes can be voided.",
        "operationId": "voidCreditNote",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Credit note ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditNoteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/customers": {
      "put": {
        "tags": [
          "Customers"
        ],
        "summary": "Update customer",
        "description": "Use when updating customer details (e.g. name, email, or metadata). Identify by id or external_customer_id.",
        "operationId": "updateCustomer",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Customer ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "external_customer_id",
            "in": "query",
            "description": "Customer External ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Customer",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCustomerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "customer"
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create customer",
        "description": "Use when onboarding a new billing customer (e.g. sign-up or CRM sync). Ideal for linking via external_customer_id to your app's user id.",
        "operationId": "createCustomer",
        "requestBody": {
          "description": "Customer",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCustomerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "write",
        "x-codegen-request-body-name": "customer"
      }
    },
    "/customers/external/{external_id}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get customer by external ID",
        "description": "Use when resolving a customer by your app's id (e.g. from your user table). Ideal for integrations that key by external id.",
        "operationId": "getCustomerByExternalId",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "description": "Customer External ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/customers/external/{external_id}/entitlements": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get customer entitlements by external ID",
        "description": "Use when checking entitlements by your app's customer id (e.g. feature gating at the edge). Supports optional filters (feature_ids, subscription_ids).",
        "operationId": "getCustomerEntitlementsByExternalID",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "description": "Customer External ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerEntitlementsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/customers/external/{external_id}/subscriptions": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get subscriptions for customer by external ID",
        "description": "Returns all subscriptions for a customer looked up by external_id, with line-item meters and entitlements attached (no pagination).",
        "operationId": "getSubscriptionsForCustomer",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "description": "Customer External ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "Comma-separated fields to expand: subscription_line_items, subscription_line_items.meters, entitlements, plan, customer",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSubscriptionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "read"
      }
    },
    "/customers/search": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Query customers",
        "description": "Use when listing or searching customers (e.g. admin CRM or reporting). Returns a paginated list; supports filtering and sorting.",
        "operationId": "queryCustomer",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.CustomerFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCustomersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "read",
        "x-codegen-request-body-name": "filter"
      }
    },
    "/customers/usage": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get customer usage summary",
        "description": "Use when showing a customer's usage (e.g. portal or overage alerts). Identify by customer_id or customer_lookup_key; supports filters.",
        "operationId": "getCustomerUsageSummary",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer_lookup_key",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "feature_ids",
            "in": "query",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "feature_lookup_keys",
            "in": "query",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "subscription_ids",
            "in": "query",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerUsageSummaryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/customers/wallets": {
      "get": {
        "tags": [
          "Wallets"
        ],
        "summary": "Get Customer Wallets",
        "description": "Use when resolving wallets by external customer id or lookup key (e.g. from your app's user id). Supports optional real-time balance and expand.",
        "operationId": "getCustomerWallets",
        "parameters": [
          {
            "name": "-",
            "in": "query",
            "description": "populated from x-max-live header, not query param",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from_cache",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_real_time_balance",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "lookup_key",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WalletResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/customers/{id}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get customer",
        "description": "Use when you need to load a single customer (e.g. for a billing portal or to attach a subscription).",
        "operationId": "getCustomer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Customer ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "read"
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Delete customer",
        "description": "Use when removing a customer (e.g. GDPR or churn). Returns 204 No Content on success.",
        "operationId": "deleteCustomer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Customer ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {}
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/customers/{id}/entitlements": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get customer entitlements",
        "description": "Use when checking what a customer can access (e.g. feature gating or usage limits). Supports optional filters (feature_ids, subscription_ids).",
        "operationId": "getCustomerEntitlements",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Customer ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerEntitlementsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/customers/{id}/grants/upcoming": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get upcoming credit grant applications",
        "description": "Use when showing upcoming or pending credits for a customer (e.g. in a portal or for forecasting).",
        "operationId": "getCustomerUpcomingGrants",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Customer ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCreditGrantApplicationsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/customers/{id}/invoices/summary": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Get customer invoice summary",
        "description": "Use when showing a customer's invoice overview (e.g. billing portal or balance summary). Includes totals and multi-currency breakdown.",
        "operationId": "getCustomerInvoiceSummary",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Customer ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerMultiCurrencyInvoiceSummary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/customers/{id}/wallets": {
      "get": {
        "tags": [
          "Wallets"
        ],
        "summary": "Get wallets by customer ID",
        "description": "Use when showing a customer's wallets (e.g. balance overview by currency or in a billing portal). Supports optional expand for balance breakdown.",
        "operationId": "getWalletsByCustomerId",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Customer ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WalletResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/entitlements": {
      "post": {
        "tags": [
          "Entitlements"
        ],
        "summary": "Create entitlement",
        "description": "Use when attaching a feature (and its limit) to a plan or addon (e.g. \"10 seats\" or \"1000 API calls\"). Defines what the plan/addon includes.",
        "operationId": "createEntitlement",
        "requestBody": {
          "description": "Entitlement configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEntitlementRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitlementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "entitlement"
      }
    },
    "/entitlements/bulk": {
      "post": {
        "tags": [
          "Entitlements"
        ],
        "summary": "Create entitlements in bulk",
        "description": "Use when attaching many features to a plan or addon at once (e.g. initial plan setup or import). Bulk version of create entitlement.",
        "operationId": "createEntitlementsBulk",
        "requestBody": {
          "description": "Bulk entitlement configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBulkEntitlementRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBulkEntitlementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "entitlements"
      }
    },
    "/entitlements/search": {
      "post": {
        "tags": [
          "Entitlements"
        ],
        "summary": "Query entitlements",
        "description": "Use when listing or searching entitlements (e.g. plan editor or audit). Returns a paginated list; supports filtering by plan, addon, feature.",
        "operationId": "queryEntitlement",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.EntitlementFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEntitlementsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/entitlements/{id}": {
      "get": {
        "tags": [
          "Entitlements"
        ],
        "summary": "Get entitlement",
        "description": "Use when you need to load a single entitlement (e.g. to display or edit a feature limit).",
        "operationId": "getEntitlement",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Entitlement ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitlementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Entitlements"
        ],
        "summary": "Update entitlement",
        "description": "Use when changing an entitlement (e.g. increasing or decreasing a limit). Request body contains the fields to update.",
        "operationId": "updateEntitlement",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Entitlement ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Entitlement configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEntitlementRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitlementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "entitlement"
      },
      "delete": {
        "tags": [
          "Entitlements"
        ],
        "summary": "Delete entitlement",
        "description": "Use when removing a feature from a plan or addon (e.g. deprecating a capability). Returns 200 with success message.",
        "operationId": "deleteEntitlement",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Entitlement ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/environments/{id}/clone": {
      "post": {
        "tags": [
          "Environments"
        ],
        "summary": "Clone an environment",
        "description": "Clone all published features and plans from the source environment into a target environment. If target_environment_id is provided, entities are cloned into that existing environment. Otherwise a new environment is created from name and type first.",
        "operationId": "cloneEnvironment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Source Environment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Clone configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloneEnvironmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.TemporalWorkflowResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "write",
        "x-codegen-request-body-name": "request"
      }
    },
    "/events": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Ingest event",
        "description": "Use when sending a single usage event from your app (e.g. one API call or one GB stored). Events are processed asynchronously; returns 202 with event_id.",
        "operationId": "ingestEvent",
        "requestBody": {
          "description": "Event data",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestEventRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "message:Event accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "event"
      }
    },
    "/events/analytics": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Get usage analytics",
        "description": "Use when building analytics views (e.g. usage by feature or customer over time). Supports filtering, grouping, and time-series breakdown.",
        "operationId": "getUsageAnalytics",
        "requestBody": {
          "description": "Request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetUsageAnalyticsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUsageAnalyticsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/events/bulk": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Bulk ingest events",
        "description": "Use when batching usage events (e.g. backfill or high-volume ingestion). More efficient than single event calls; returns 202 when accepted.",
        "operationId": "ingestEventsBulk",
        "requestBody": {
          "description": "Event data",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkIngestEventRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "message:Event accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "event"
      }
    },
    "/events/huggingface-inference": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Get Hugging Face inference data",
        "description": "Use when fetching Hugging Face inference usage or billing data (e.g. for HF-specific reporting or reconciliation). Reads the meter-usage pipeline.",
        "operationId": "getHuggingfaceInferenceData",
        "requestBody": {
          "description": "Request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetHuggingFaceBillingDataRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetHuggingFaceBillingDataResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/events/lookup": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "Get event",
        "description": "Use when debugging a specific event (e.g. why it failed or how it was aggregated). Reads the meter-usage pipeline; includes processing status and step-by-step debug tracker when unprocessed. Uses ?id= query param because event IDs can contain \"/\".",
        "operationId": "getEvent",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Event ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetEventByIDResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/events/query": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "List raw events",
        "description": "Use when debugging ingestion or exporting raw event data (e.g. support or audit). Returns a paginated list; supports time range and sorting.",
        "operationId": "listRawEvents",
        "requestBody": {
          "description": "Request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetEventsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetEventsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/events/usage": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Get usage statistics",
        "description": "Use when building usage reports or dashboards across events. Supports filters and grouping; defaults to last 7 days if no range provided.",
        "operationId": "getUsageStatistics",
        "requestBody": {
          "description": "Request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetUsageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUsageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/events/usage/meter": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Get usage by meter",
        "description": "Use when showing usage for a specific meter (e.g. dashboard or overage check). Supports time range, filters, and grouping by customer or subscription.",
        "operationId": "getUsageByMeter",
        "requestBody": {
          "description": "Request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetUsageByMeterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUsageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/features": {
      "post": {
        "tags": [
          "Features"
        ],
        "summary": "Create feature",
        "description": "Use when defining a new feature or capability to gate or meter (e.g. feature flags or usage-based limits). Ideal for boolean or usage features.",
        "operationId": "createFeature",
        "requestBody": {
          "description": "Feature to create",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFeatureRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "feature"
      }
    },
    "/features/search": {
      "post": {
        "tags": [
          "Features"
        ],
        "summary": "Query features",
        "description": "Use when listing or searching features (e.g. catalog or entitlement setup). Returns a paginated list; supports filtering and sorting.",
        "operationId": "queryFeature",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.FeatureFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListFeaturesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/features/{id}": {
      "put": {
        "tags": [
          "Features"
        ],
        "summary": "Update feature",
        "description": "Use when changing feature definition (e.g. name, type, or meter). Request body contains the fields to update.",
        "operationId": "updateFeature",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Feature ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Feature update data",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFeatureRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "feature"
      },
      "delete": {
        "tags": [
          "Features"
        ],
        "summary": "Delete feature",
        "description": "Use when retiring a feature (e.g. deprecated capability). Returns 200 with success message.",
        "operationId": "deleteFeature",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Feature ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/features/{id}/clone": {
      "post": {
        "tags": [
          "Features"
        ],
        "summary": "Clone a feature",
        "description": "Clone an existing feature",
        "operationId": "cloneFeature",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Source Feature ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Clone configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloneFeatureRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "write",
        "x-codegen-request-body-name": "request"
      }
    },
    "/groups": {
      "post": {
        "tags": [
          "Groups"
        ],
        "summary": "Create group",
        "description": "Use when organizing entities into a group (e.g. for filtering prices or plans by product line or region).",
        "operationId": "createGroup",
        "requestBody": {
          "description": "Group",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "group"
      }
    },
    "/groups/search": {
      "post": {
        "tags": [
          "Groups"
        ],
        "summary": "Query groups",
        "description": "Use when listing or searching groups (e.g. admin catalog). Returns a paginated list; supports filtering and sorting.",
        "operationId": "queryGroup",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.GroupFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListGroupsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/groups/{id}": {
      "get": {
        "tags": [
          "Groups"
        ],
        "summary": "Get group",
        "description": "Use when you need to load a single group (e.g. for display or to assign entities).",
        "operationId": "getGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Group ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Groups"
        ],
        "summary": "Delete group",
        "description": "Use when removing a group and clearing its entity associations (e.g. retiring a product line). Returns 204 or 200 on success.",
        "operationId": "deleteGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Group ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {}
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/integrations/config": {
      "get": {
        "tags": [
          "Integrations"
        ],
        "summary": "Get integration configurations",
        "description": "Returns the base capabilities and current sync configuration for all connected providers.",
        "operationId": "getIntegrationConfig",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationConfigResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/integrations/link": {
      "post": {
        "tags": [
          "Integrations"
        ],
        "summary": "Link integration mapping",
        "description": "Link a FlexPrice entity to provider entity with provider-specific side effects.",
        "operationId": "linkIntegrationMapping",
        "requestBody": {
          "description": "Link mapping request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkIntegrationMappingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkIntegrationMappingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      },
      "delete": {
        "tags": [
          "Integrations"
        ],
        "summary": "Delink integration mapping",
        "description": "Soft-delete (archive) the mapping between a FlexPrice entity and a provider entity.",
        "operationId": "delinkIntegrationMapping",
        "requestBody": {
          "description": "Delink mapping request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DelinkIntegrationMappingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/integrations/mappings": {
      "get": {
        "tags": [
          "Integrations"
        ],
        "summary": "Get entity integration mappings",
        "description": "Get integration mappings for a specific entity by entity type and entity ID.",
        "operationId": "getEntityIntegrationMappings",
        "parameters": [
          {
            "name": "entity_type",
            "in": "query",
            "description": "Entity type (customer, plan, invoice, subscription, payment, credit_note, addon, item, item_price, price)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entity_id",
            "in": "query",
            "description": "Entity ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEntityIntegrationMappingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/invoices": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Create one-off invoice",
        "description": "Use when creating a manual or one-off invoice (e.g. custom charge or non-recurring billing). Invoice is created in draft; finalize when ready.",
        "operationId": "createInvoice",
        "requestBody": {
          "description": "Invoice details",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "invoice"
      }
    },
    "/invoices/preview": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Get invoice preview",
        "description": "Use when showing a customer what they will be charged (e.g. preview before checkout or plan change). No invoice is created.",
        "operationId": "getInvoicePreview",
        "requestBody": {
          "description": "Preview Invoice Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetPreviewInvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/invoices/search": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Query invoices",
        "description": "Use when listing or searching invoices (e.g. admin view or customer history). Returns a paginated list; supports filtering by customer, status, date range.",
        "operationId": "queryInvoice",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.InvoiceFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListInvoicesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/invoices/{id}": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Get invoice",
        "description": "Use when loading an invoice for display or editing (e.g. portal or reconciliation). Supports group_by for usage breakdown and force_runtime_recalculation.",
        "operationId": "getInvoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand_by_source",
            "in": "query",
            "description": "Include source-level price breakdown for usage line items (legacy)",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "group_by",
            "in": "query",
            "description": "Group usage breakdown by specified fields (e.g., source, feature_id, properties.org_id)",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "Comma-separated related fields to include. Supports 'tax_applied.tax_rate' to attach rate details to each applied tax.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Invoices"
        ],
        "summary": "Update invoice",
        "description": "Use when updating invoice metadata or due date (e.g. PDF URL, net terms), or when recalculating this draft invoice's discount from its current standing coupon associations via apply_discount:true (idempotent, does not attach a new coupon). Allowed for invoices in draft or finalized status.",
        "operationId": "updateInvoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Invoice Update Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/invoices/{id}/comms/trigger": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Trigger invoice communication webhook",
        "description": "Use when sending an invoice to the customer (e.g. trigger email or Slack). Payload includes full invoice details for your integration.",
        "operationId": "triggerInvoiceCommsWebhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/invoices/{id}/finalize": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Finalize invoice",
        "description": "Use when locking an invoice for payment (e.g. after review). Once finalized, line items are locked; invoice can be paid or voided.",
        "operationId": "finalizeInvoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "delete"
      }
    },
    "/invoices/{id}/payment": {
      "put": {
        "tags": [
          "Invoices"
        ],
        "summary": "Update invoice payment status",
        "description": "Use when reconciling payment status from an external gateway or manual entry (e.g. mark paid after bank confirmation).",
        "operationId": "updateInvoicePaymentStatus",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Payment Status Update Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentStatusRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/invoices/{id}/payment/attempt": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Attempt invoice payment",
        "description": "Use when paying an invoice with the customer's wallet balance (e.g. prepaid credits or balance applied at checkout).",
        "operationId": "attemptInvoicePayment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/invoices/{id}/pdf": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Get invoice PDF",
        "description": "Use when delivering an invoice PDF to the customer (e.g. email attachment or download). Use url=true for a presigned URL instead of binary. Use force_generate=true to regenerate and re-upload the PDF even if one already exists in S3.",
        "operationId": "getInvoicePdf",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "url",
            "in": "query",
            "description": "Return presigned URL from s3 instead of PDF",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "force_generate",
            "in": "query",
            "description": "Force regeneration of the PDF even if one already exists in S3 (default: false). Note: force_generate has no effect if invoice_pdf_url is already set on the invoice.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/invoices/{id}/recalculate": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Recalculate invoice (voided invoice)",
        "description": "Starts an async workflow that creates a fresh replacement invoice for a voided SUBSCRIPTION invoice (same billing period). Returns workflow_id and run_id; poll workflow status or GET the new invoice via recalculated_invoice_id after completion.",
        "operationId": "recalculateInvoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.TemporalWorkflowResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or invoice already recalculated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/invoices/{id}/recalculate-v2": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Recalculate draft invoice (v2)",
        "description": "Recalculates a draft SUBSCRIPTION invoice in-place (replaces line items, reapplies credits/coupons/taxes). Use when subscription or usage data changed before finalizing.",
        "operationId": "recalculateInvoiceV2",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "finalize",
            "in": "query",
            "description": "Whether to finalize the invoice after recalculation (default: true)",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/invoices/{id}/void": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Void invoice",
        "description": "Use when cancelling an invoice (e.g. order cancelled or duplicate). Only unpaid invoices can be voided.",
        "operationId": "voidInvoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/marketplace/agreements": {
      "post": {
        "tags": [
          "Marketplace"
        ],
        "summary": "Register an AWS Marketplace agreement",
        "description": "Registers an AWS Marketplace buyer agreement against an existing Flexprice subscription, upserting plan/subscription/customer integration mappings in one call.",
        "requestBody": {
          "description": "Agreement registration request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterMarketplaceAgreementRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterMarketplaceAgreementResponse"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "request"
      }
    },
    "/payments": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "List payments",
        "description": "Use when listing or searching payments (e.g. reconciliation UI or customer payment history). Returns a paginated list; supports filtering by customer, invoice, status.",
        "operationId": "listPayments",
        "parameters": [
          {
            "name": "currency",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "destination_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "destination_type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_time",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "gateway_payment_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "gateway_tracking_id",
            "in": "query",
            "description": "For filtering by gateway tracking ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "payment_gateway",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payment_ids",
            "in": "query",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "payment_method_type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payment_status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_time",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "published",
                "deleted",
                "archived"
              ],
              "x-enum-varnames": [
                "StatusPublished",
                "StatusDeleted",
                "StatusArchived"
              ]
            },
            "x-enum-varnames": [
              "StatusPublished",
              "StatusDeleted",
              "StatusArchived"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated payments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPaymentsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Create payment",
        "description": "Use when recording a payment against an invoice (e.g. after receiving funds via a gateway or manual entry).",
        "operationId": "createPayment",
        "requestBody": {
          "description": "Payment configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created payment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "payment"
      }
    },
    "/payments/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Get payment",
        "description": "Use when you need to load a single payment (e.g. for a receipt view or reconciliation).",
        "operationId": "getPayment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Payment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Payment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Payments"
        ],
        "summary": "Update payment",
        "description": "Use when updating payment status or metadata (e.g. after reconciliation or adding a reference).",
        "operationId": "updatePayment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Payment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Payment configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated payment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "payment"
      },
      "delete": {
        "tags": [
          "Payments"
        ],
        "summary": "Delete payment",
        "description": "Use when removing or voiding a payment record (e.g. correcting erroneous entries). Returns 200 with success message.",
        "operationId": "deletePayment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Payment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Payment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/payments/{id}/process": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Process payment",
        "description": "Use when you need to charge or process a payment (e.g. trigger the payment provider to capture funds). Returns updated payment with status.",
        "operationId": "processPayment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Payment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Processed payment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Payment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/plans": {
      "post": {
        "tags": [
          "Plans"
        ],
        "summary": "Create plan",
        "description": "Use when defining a new pricing plan (e.g. Free, Pro, Enterprise). Attach prices and entitlements; customers subscribe to plans.",
        "operationId": "createPlan",
        "requestBody": {
          "description": "Plan configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePlanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "plan"
      }
    },
    "/plans/search": {
      "post": {
        "tags": [
          "Plans"
        ],
        "summary": "Query plans",
        "description": "Use when listing or searching plans (e.g. plan picker or admin catalog). Returns a paginated list; supports filtering and sorting.",
        "operationId": "queryPlan",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.PlanFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPlansResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/plans/{id}": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "Get plan",
        "description": "Use when you need to load a single plan (e.g. for display or to create a subscription).",
        "operationId": "getPlan",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Plan ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Plans"
        ],
        "summary": "Update plan",
        "description": "Use when changing plan details (e.g. name, interval, or metadata). Partial update supported.",
        "operationId": "updatePlan",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Plan ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Plan update",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePlanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "plan"
      },
      "delete": {
        "tags": [
          "Plans"
        ],
        "summary": "Delete plan",
        "description": "Use when retiring a plan (e.g. end-of-life). Existing subscriptions may be affected. Returns 200 with success message.",
        "operationId": "deletePlan",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Plan ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/plans/{id}/clone": {
      "post": {
        "tags": [
          "Plans"
        ],
        "summary": "Clone a plan",
        "description": "Clone an existing plan, copying its active prices, published entitlements, and published credit grants",
        "operationId": "clonePlan",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Source Plan ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Clone configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClonePlanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "write",
        "x-codegen-request-body-name": "request"
      }
    },
    "/plans/{id}/creditgrants": {
      "get": {
        "tags": [
          "Credit Grants"
        ],
        "summary": "Get plan credit grants",
        "description": "Use when listing credits attached to a plan (e.g. included prepaid or promo credits).",
        "operationId": "getPlanCreditGrants",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Plan ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCreditGrantsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/plans/{id}/entitlements": {
      "get": {
        "tags": [
          "Entitlements"
        ],
        "summary": "Get plan entitlements",
        "description": "Use when checking what a plan includes (e.g. feature list or limits for display or gating).",
        "operationId": "getPlanEntitlements",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Plan ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEntitlementsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/plans/{id}/sync/subscriptions": {
      "post": {
        "tags": [
          "Plans"
        ],
        "summary": "Synchronize plan prices",
        "description": "Use when you have changed plan prices and need to push them to all active subscriptions (e.g. global price update). Returns workflow ID.",
        "operationId": "syncPlanPrices",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Plan ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.TemporalWorkflowResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/prices": {
      "post": {
        "tags": [
          "Prices"
        ],
        "summary": "Create price",
        "description": "Use when adding a new price to a plan or catalog (e.g. per-seat, flat, or metered). Ideal for both simple and usage-based pricing.",
        "operationId": "createPrice",
        "requestBody": {
          "description": "Price configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePriceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "price"
      }
    },
    "/prices/bulk": {
      "post": {
        "tags": [
          "Prices"
        ],
        "summary": "Create prices in bulk",
        "description": "Use when creating many prices at once (e.g. importing a catalog or setting up a plan with multiple tiers).",
        "operationId": "createPricesBulk",
        "requestBody": {
          "description": "Bulk price configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBulkPriceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBulkPriceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "prices"
      }
    },
    "/prices/lookup/{lookup_key}": {
      "get": {
        "tags": [
          "Prices"
        ],
        "summary": "Get price by lookup key",
        "description": "Use when resolving a price by external id (e.g. from your catalog or CMS). Ideal for integrations.",
        "operationId": "getPriceByLookupKey",
        "parameters": [
          {
            "name": "lookup_key",
            "in": "path",
            "description": "Lookup key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/prices/search": {
      "post": {
        "tags": [
          "Prices"
        ],
        "summary": "Query prices",
        "description": "Use when listing or searching prices (e.g. plan builder or catalog). Returns a paginated list; supports filtering and sorting.",
        "operationId": "queryPrice",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.PriceFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPricesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/prices/units": {
      "get": {
        "tags": [
          "Price Units"
        ],
        "summary": "List price units",
        "description": "Use when listing price units (e.g. in a catalog or when creating prices). Returns a paginated list; supports status, sort, and pagination.",
        "operationId": "listPriceUnits",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Limit number of results",
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer",
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Offset for pagination",
            "schema": {
              "minimum": 0,
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Sort field",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPriceUnitsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Price Units"
        ],
        "summary": "Create price unit",
        "description": "Use when defining a new unit of measure for pricing (e.g. GB, API call, seat). Ideal for metered or usage-based prices.",
        "operationId": "createPriceUnit",
        "requestBody": {
          "description": "Price unit details",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePriceUnitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePriceUnitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    },
    "/prices/units/code/{code}": {
      "get": {
        "tags": [
          "Price Units"
        ],
        "summary": "Get price unit by code",
        "description": "Use when resolving a price unit by code (e.g. from an external catalog or config). Ideal for integrations.",
        "operationId": "getPriceUnitByCode",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "description": "Price unit code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceUnitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/prices/units/search": {
      "post": {
        "tags": [
          "Price Units"
        ],
        "summary": "Query price units",
        "description": "Use when searching or listing price units (e.g. admin catalog). Returns a paginated list; supports filtering and sorting.",
        "operationId": "queryPriceUnit",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.PriceUnitFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPriceUnitsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/prices/units/{id}": {
      "get": {
        "tags": [
          "Price Units"
        ],
        "summary": "Get price unit",
        "description": "Use when you need to load a single price unit (e.g. for display or when creating a price).",
        "operationId": "getPriceUnit",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Price unit ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceUnitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Price Units"
        ],
        "summary": "Update price unit",
        "description": "Use when renaming or updating metadata for a price unit. Code is immutable once created.",
        "operationId": "updatePriceUnit",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Price unit ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Price unit details to update",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePriceUnitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceUnitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "body"
      },
      "delete": {
        "tags": [
          "Price Units"
        ],
        "summary": "Delete price unit",
        "description": "Use when removing a price unit that is no longer needed. Fails if any price references this unit.",
        "operationId": "deletePriceUnit",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Price unit ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/prices/{id}": {
      "get": {
        "tags": [
          "Prices"
        ],
        "summary": "Get price",
        "description": "Use when you need to load a single price (e.g. for display or editing). Response includes expanded meter and price unit when applicable.",
        "operationId": "getPrice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Price ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Prices"
        ],
        "summary": "Update price",
        "description": "Use when changing price configuration (e.g. amount, billing scheme, or metadata).",
        "operationId": "updatePrice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Price ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Price configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePriceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "price"
      },
      "delete": {
        "tags": [
          "Prices"
        ],
        "summary": "Delete price",
        "description": "Use when retiring a price (e.g. end-of-life or replacement). Optional effective date or cascade for subscriptions.",
        "operationId": "deletePrice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Price ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Delete Price Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeletePriceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/rbac/roles": {
      "get": {
        "tags": [
          "RBAC"
        ],
        "summary": "List all RBAC roles",
        "description": "Use when building role pickers or permission UIs. Returns all roles with permissions and descriptions.",
        "operationId": "listRbacRoles",
        "parameters": [
          {
            "name": "user_type",
            "in": "query",
            "description": "Filter by user type",
            "schema": {
              "type": "string",
              "enum": [
                "user",
                "service_account"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of roles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/rbac/roles/{id}": {
      "get": {
        "tags": [
          "RBAC"
        ],
        "summary": "Get a specific RBAC role",
        "description": "Use when you need to show or edit a single role (e.g. role detail page). Includes permissions, name, and description.",
        "operationId": "getRbacRole",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Role ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Role details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Role not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/secrets/api/keys": {
      "get": {
        "tags": [
          "Secrets"
        ],
        "summary": "List API keys",
        "description": "Use when listing API keys (e.g. admin view or rotating keys). Returns a paginated list.",
        "operationId": "listApiKeys",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Status (published/archived)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSecretsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Secrets"
        ],
        "summary": "Create a new API key",
        "description": "Use when issuing a new API key (e.g. for a service account or for the current user). Provide service_account_id to create for a service account.",
        "operationId": "createApiKey",
        "requestBody": {
          "description": "API key creation request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAPIKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAPIKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/secrets/api/keys/{id}": {
      "delete": {
        "tags": [
          "Secrets"
        ],
        "summary": "Delete an API key",
        "description": "Use when revoking an API key (e.g. rotation or compromise). Permanently invalidates the key.",
        "operationId": "deleteApiKey",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "API key ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {}
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/subscriptions": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create subscription",
        "description": "Use when onboarding a customer to a plan or starting a new subscription. Ideal for draft subscriptions (activate later) or active from start.",
        "operationId": "createSubscription",
        "requestBody": {
          "description": "Subscription Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "subscription"
      }
    },
    "/subscriptions/addon": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Add addon to subscription",
        "description": "Use when adding an optional product or add-on to an existing subscription (e.g. extra storage or support tier).",
        "operationId": "addSubscriptionAddon",
        "requestBody": {
          "description": "Add Addon Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddAddonRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddAddonToSubscriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      },
      "delete": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Remove addon from subscription",
        "description": "Use when removing an add-on from a subscription (e.g. downgrade or opt-out).",
        "operationId": "removeSubscriptionAddon",
        "requestBody": {
          "description": "Remove Addon Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveAddonRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/lineitems/search": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Search subscription line items",
        "description": "List subscription line items with a JSON filter (subscription, customer, price, pagination, expand=prices, etc.).",
        "operationId": "querySubscriptionLineItems",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.SubscriptionLineItemFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSubscriptionLineItemsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "read",
        "x-codegen-request-body-name": "filter"
      }
    },
    "/subscriptions/lineitems/{id}": {
      "put": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Update subscription line item",
        "description": "Use when changing a subscription line item (e.g. quantity or price). Implemented by ending the current line and creating a new one for clean billing.",
        "operationId": "updateSubscriptionLineItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Line Item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Update Line Item Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSubscriptionLineItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionLineItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      },
      "delete": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Delete subscription line item",
        "description": "Use when removing a charge or seat from a subscription (e.g. downgrade). Line item ends; retained for history but no longer billed.",
        "operationId": "deleteSubscriptionLineItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Line Item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Delete Line Item Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteSubscriptionLineItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionLineItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/search": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Query subscriptions",
        "description": "Use when listing or searching subscriptions (e.g. admin view or customer subscription list). Returns a paginated list; supports filtering by customer, plan, status.",
        "operationId": "querySubscription",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.SubscriptionFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSubscriptionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/subscriptions/usage": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get usage by subscription",
        "description": "Use when showing usage for a subscription (e.g. in a portal or for overage checks). Supports time range and filters.",
        "operationId": "getSubscriptionUsage",
        "requestBody": {
          "description": "Usage request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetUsageBySubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUsageBySubscriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/{id}": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get subscription",
        "description": "Use when you need to load a single subscription (e.g. for a billing portal or to check status).",
        "operationId": "getSubscription",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Update subscription",
        "description": "Use when changing subscription details (e.g. quantity, billing anchor, or parent). Supports partial update; send \"\" to clear parent_subscription_id.",
        "operationId": "updateSubscription",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Update Subscription Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/{id}/activate": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Activate draft subscription",
        "description": "Use when turning a draft subscription live (e.g. after collecting payment or completing setup). Once activated, billing and entitlements apply.",
        "operationId": "activateSubscription",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Activate Draft Subscription Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivateDraftSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/{id}/addons/associations": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get active addon associations",
        "description": "Use when listing which add-ons are currently attached to a subscription (e.g. for display or editing).",
        "operationId": "getSubscriptionAddonAssociations",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AddonAssociationResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/subscriptions/{id}/cancel": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Cancel subscription",
        "description": "Use when a customer churns or downgrades. Supports immediate or end-of-period cancellation and proration. Ideal for self-serve or support-driven cancellations.",
        "operationId": "cancelSubscription",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Cancel Subscription Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelSubscriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/{id}/change/execute": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Execute subscription plan change",
        "description": "Use when applying a plan change (e.g. upgrade or downgrade). Executes proration and generates invoice or credit as needed.",
        "operationId": "executeSubscriptionChange",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Subscription change request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscriptionChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChangeExecuteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/{id}/change/preview": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Preview subscription plan change",
        "description": "Use when showing a customer the cost of a plan change before they confirm (e.g. upgrade/downgrade preview with proration).",
        "operationId": "previewSubscriptionChange",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Subscription change preview request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscriptionChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChangePreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/{id}/change/v2/execute": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Execute a plan change (v2, swap in place)",
        "description": "Change a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction.",
        "operationId": "executeSubscriptionPlanChangeV2",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Plan change request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscriptionChangeV2Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChangeV2Response"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, or a change this endpoint cannot make (interval, currency, hierarchy, phases, paused)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Subscription or plan not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "write",
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/{id}/change/v2/preview": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Preview a plan change (v2, swap in place)",
        "description": "Preview a subscription plan change without writing. Swap-in-place: subscription id, billing anchor and period bounds are preserved.",
        "operationId": "previewSubscriptionPlanChangeV2",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Plan change request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscriptionChangeV2Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChangeV2Response"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, or a change this endpoint cannot make (interval, currency, hierarchy, phases, paused)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Subscription or plan not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "read",
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/{id}/entitlements": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get subscription entitlements",
        "description": "Use when checking what features or limits a subscription has (e.g. entitlement checks or feature gating). Optional feature_ids to filter.",
        "operationId": "getSubscriptionEntitlements",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "feature_ids",
            "in": "query",
            "description": "Feature IDs to filter by",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionEntitlementsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/subscriptions/{id}/grants/upcoming": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get upcoming credit grant applications",
        "description": "Use when showing upcoming or pending credits for a subscription (e.g. in a portal or for forecasting).",
        "operationId": "getSubscriptionUpcomingGrants",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCreditGrantApplicationsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/subscriptions/{id}/lineitems": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create subscription line item",
        "description": "Use when adding a new charge or seat to a subscription (e.g. extra seat or one-time add). Supports price_id or inline price.",
        "operationId": "createSubscriptionLineItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Create Line Item Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionLineItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionLineItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/{id}/modify/execute": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Execute subscription modification",
        "description": "Execute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax).",
        "operationId": "executeSubscriptionModify",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Modification request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteSubscriptionModifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionModifyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "write",
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/{id}/modify/preview": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Preview subscription modification",
        "description": "Preview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax) without committing changes.",
        "operationId": "previewSubscriptionModify",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Modification preview request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteSubscriptionModifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionModifyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-scope": "read",
        "x-codegen-request-body-name": "request"
      }
    },
    "/subscriptions/{id}/v2": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get subscription (V2)",
        "description": "Use when you need a subscription with related data (line items, prices, plan). Supports expand for detailed payloads without extra round-trips.",
        "operationId": "getSubscriptionV2",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "Comma-separated list of fields to expand (e.g., 'subscription_line_items,prices,plan')",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/tasks": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "List tasks",
        "description": "Use when listing or searching async tasks (e.g. admin queue view). Returns list with optional filtering.",
        "operationId": "listTasks",
        "parameters": [
          {
            "name": "created_by",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_time",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entity_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "EVENTS",
                "PRICES",
                "CUSTOMERS",
                "FEATURES"
              ],
              "x-enum-varnames": [
                "EntityTypeEvents",
                "EntityTypePrices",
                "EntityTypeCustomers",
                "EntityTypeFeatures"
              ]
            },
            "x-enum-varnames": [
              "EntityTypeEvents",
              "EntityTypePrices",
              "EntityTypeCustomers",
              "EntityTypeFeatures"
            ]
          },
          {
            "name": "expand",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "scheduled_task_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_time",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "published",
                "deleted",
                "archived"
              ],
              "x-enum-varnames": [
                "StatusPublished",
                "StatusDeleted",
                "StatusArchived"
              ]
            },
            "x-enum-varnames": [
              "StatusPublished",
              "StatusDeleted",
              "StatusArchived"
            ]
          },
          {
            "name": "task_status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "PROCESSING",
                "COMPLETED",
                "FAILED"
              ],
              "x-enum-varnames": [
                "TaskStatusPending",
                "TaskStatusProcessing",
                "TaskStatusCompleted",
                "TaskStatusFailed"
              ]
            },
            "x-enum-varnames": [
              "TaskStatusPending",
              "TaskStatusProcessing",
              "TaskStatusCompleted",
              "TaskStatusFailed"
            ]
          },
          {
            "name": "task_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "IMPORT",
                "EXPORT"
              ],
              "x-enum-varnames": [
                "TaskTypeImport",
                "TaskTypeExport"
              ]
            },
            "x-enum-varnames": [
              "TaskTypeImport",
              "TaskTypeExport"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTasksResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/tasks/result": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "Get task processing result",
        "description": "Use when fetching the outcome of a completed task (e.g. export URL or error message). Call after task status is complete.",
        "operationId": "getTaskResult",
        "parameters": [
          {
            "name": "workflow_id",
            "in": "query",
            "description": "Workflow ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/models.TemporalWorkflowResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/tasks/scheduled": {
      "get": {
        "tags": [
          "Scheduled Tasks"
        ],
        "summary": "List scheduled tasks",
        "description": "Use when listing or managing scheduled tasks in an admin UI. Returns a list; supports filtering by status, type, and pagination.",
        "operationId": "listScheduledTasks",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "connection_id",
            "in": "query",
            "description": "Filter by connection ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entity_type",
            "in": "query",
            "description": "Filter by entity type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "description": "Filter by interval",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "enabled",
            "in": "query",
            "description": "Filter by enabled status",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListScheduledTasksResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Scheduled Tasks"
        ],
        "summary": "Create scheduled task",
        "description": "Use when setting up recurring data exports or other scheduled jobs. Ideal for report generation or syncing data on a schedule.",
        "operationId": "createScheduledTask",
        "requestBody": {
          "description": "Scheduled Task",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScheduledTaskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledTaskResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "scheduled_task"
      }
    },
    "/tasks/scheduled/schedule-draft-finalization": {
      "post": {
        "tags": [
          "Scheduled Tasks"
        ],
        "summary": "Schedule draft finalization",
        "description": "Triggers the draft invoice finalization workflow that scans computed draft invoices whose finalization delay has elapsed and finalizes them (assign invoice number, sync to vendors, attempt payment).",
        "operationId": "scheduleDraftFinalization",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/tasks/scheduled/schedule-update-billing-period": {
      "post": {
        "tags": [
          "Scheduled Tasks"
        ],
        "summary": "Schedule update billing period",
        "description": "Use when you need to trigger a billing-period update workflow (e.g. to recalculate or sync billing windows).",
        "operationId": "scheduleUpdateBillingPeriod",
        "requestBody": {
          "description": "Schedule Update Billing Period Request",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/tasks/scheduled/{id}": {
      "get": {
        "tags": [
          "Scheduled Tasks"
        ],
        "summary": "Get scheduled task",
        "description": "Use when you need to load a single scheduled task (e.g. to show details in a UI or check its configuration).",
        "operationId": "getScheduledTask",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Scheduled Task ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledTaskResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Scheduled Tasks"
        ],
        "summary": "Update a scheduled task",
        "description": "Use when pausing or resuming a scheduled task. Only the enabled field can be changed.",
        "operationId": "updateScheduledTask",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Scheduled Task ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Update request (enabled: true/false to pause/resume)",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduledTaskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledTaskResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or task is archived",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Scheduled task not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Failed to update Temporal schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "scheduled_task"
      },
      "delete": {
        "tags": [
          "Scheduled Tasks"
        ],
        "summary": "Delete a scheduled task",
        "description": "Use when removing a scheduled task from the active roster. Archives the task and removes it from the scheduler (soft delete).",
        "operationId": "deleteScheduledTask",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Scheduled Task ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Scheduled task archived successfully",
            "content": {}
          },
          "400": {
            "description": "Task already archived",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Scheduled task not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Failed to archive task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/tasks/scheduled/{id}/run": {
      "post": {
        "tags": [
          "Scheduled Tasks"
        ],
        "summary": "Trigger force run",
        "description": "Use when you need to run a scheduled export immediately (e.g. on-demand report or catch-up). Supports optional custom time range.",
        "operationId": "triggerScheduledTaskRun",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Scheduled Task ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Optional start and end time for custom range",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerForceRunRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "Returns workflow details and time range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerForceRunResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/tasks/{id}": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "Get a task",
        "description": "Use when checking task status or progress (e.g. polling after create). Returns task by ID.",
        "operationId": "getTask",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Task ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/tasks/{id}/download": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "Download task export file",
        "description": "Use when letting a user download an exported file (e.g. report or data export). Returns a presigned URL; supports FlexPrice or customer-owned S3.",
        "operationId": "downloadTaskExport",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Task ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/tasks/{id}/status": {
      "put": {
        "tags": [
          "Tasks"
        ],
        "summary": "Update task status",
        "description": "Use when updating task status (e.g. marking complete or failed from a worker). Typically called by backend processors.",
        "operationId": "updateTaskStatus",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Task ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Status update",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTaskStatusRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "status"
      }
    },
    "/taxes/associations": {
      "get": {
        "tags": [
          "Tax Associations"
        ],
        "summary": "List tax associations",
        "description": "Use when listing tax associations (e.g. tax config or audit). Returns list with optional filtering.",
        "operationId": "listTaxAssociations",
        "parameters": [
          {
            "name": "entity_type",
            "in": "query",
            "description": "Entity Type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entity_id",
            "in": "query",
            "description": "Entity ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "external_customer_id",
            "in": "query",
            "description": "External Customer ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tax_rate_id",
            "in": "query",
            "description": "Tax Rate ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTaxAssociationsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Tax Associations"
        ],
        "summary": "Create Tax Association",
        "description": "Use when linking a tax rate to an entity (e.g. customer, product, or region) so that rate applies on invoices.",
        "operationId": "createTaxAssociation",
        "requestBody": {
          "description": "Tax Config Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaxAssociationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxAssociationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "tax_config"
      }
    },
    "/taxes/associations/{id}": {
      "get": {
        "tags": [
          "Tax Associations"
        ],
        "summary": "Get Tax Association",
        "description": "Use when you need to load a single tax association (e.g. for display or editing).",
        "operationId": "getTaxAssociation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Tax Config ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxAssociationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Tax Associations"
        ],
        "summary": "Update tax association",
        "description": "Use when changing a tax association (e.g. switch rate or entity). Request body contains the fields to update.",
        "operationId": "updateTaxAssociation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Tax Config ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Tax Config Request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxAssociationUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxAssociationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "tax_config"
      },
      "delete": {
        "tags": [
          "Tax Associations"
        ],
        "summary": "Delete tax association",
        "description": "Use when removing a tax association (e.g. entity no longer subject to that rate).",
        "operationId": "deleteTaxAssociation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Tax Config ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxAssociationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/taxes/rates": {
      "get": {
        "tags": [
          "Tax Rates"
        ],
        "summary": "Get tax rates",
        "description": "Use when listing tax rates (e.g. tax config UI). Returns tax rates with optional filters.",
        "operationId": "getTaxRates",
        "parameters": [
          {
            "name": "end_time",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "INTERNAL",
                "EXTERNAL",
                "ONETIME"
              ],
              "x-enum-varnames": [
                "TaxRateScopeInternal",
                "TaxRateScopeExternal",
                "TaxRateScopeOneTime"
              ]
            },
            "x-enum-varnames": [
              "TaxRateScopeInternal",
              "TaxRateScopeExternal",
              "TaxRateScopeOneTime"
            ]
          },
          {
            "name": "start_time",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "published",
                "deleted",
                "archived"
              ],
              "x-enum-varnames": [
                "StatusPublished",
                "StatusDeleted",
                "StatusArchived"
              ]
            },
            "x-enum-varnames": [
              "StatusPublished",
              "StatusDeleted",
              "StatusArchived"
            ]
          },
          {
            "name": "taxrate_codes",
            "in": "query",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "taxrate_ids",
            "in": "query",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTaxRatesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Tax Rates"
        ],
        "summary": "Create a tax rate",
        "description": "Use when defining a new tax rate (e.g. VAT or sales tax) for use in invoices. Attach to customers or products via tax associations.",
        "operationId": "createTaxRate",
        "requestBody": {
          "description": "Tax rate to create",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaxRateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxRateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "tax_rate"
      }
    },
    "/taxes/rates/{id}": {
      "get": {
        "tags": [
          "Tax Rates"
        ],
        "summary": "Get a tax rate",
        "description": "Use when you need to load a single tax rate (e.g. for display or when creating an association).",
        "operationId": "getTaxRate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Tax rate ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxRateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Tax Rates"
        ],
        "summary": "Update a tax rate",
        "description": "Use when changing a tax rate (e.g. rate value or name). Request body contains the fields to update.",
        "operationId": "updateTaxRate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Tax rate ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Tax rate to update",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTaxRateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxRateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "tax_rate"
      },
      "delete": {
        "tags": [
          "Tax Rates"
        ],
        "summary": "Delete a tax rate",
        "description": "Use when retiring a tax rate (e.g. no longer applicable). Fails if still referenced by associations.",
        "operationId": "deleteTaxRate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Tax rate ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {}
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/tenant/billing": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Get billing usage for the current tenant",
        "description": "Use when showing the current tenant's billing usage (e.g. admin billing page or usage caps). Returns subscription and usage for the tenant.",
        "operationId": "getTenantBillingUsage",
        "responses": {
          "200": {
            "description": "Tenant billing usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantBillingUsage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Tenant not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/tenants/update": {
      "put": {
        "tags": [
          "Tenants"
        ],
        "summary": "Update a tenant",
        "description": "Use when changing tenant details (e.g. name or billing info). Request body contains the fields to update.",
        "operationId": "updateTenant",
        "requestBody": {
          "description": "Update tenant request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated tenant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Tenant not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/tenants/{id}": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Get tenant by ID",
        "description": "Get tenant by ID",
        "operationId": "getTenantById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tenant details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponse"
                }
              }
            }
          },
          "404": {
            "description": "Tenant not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/users": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create user or service account",
        "description": "Create a user account (type=user, email required; returns user + password for login) or a service account (type=service_account, roles required) for API/automation access.",
        "operationId": "createUser",
        "requestBody": {
          "description": "Create user (email, type=user) or service account (type=service_account, roles)",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/users/me": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get current user",
        "description": "Use to show the logged-in user's profile in the UI or to check permissions and roles for the current session.",
        "operationId": "getUserInfo",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update current user",
        "description": "Update the current authenticated user. Supports name and metadata updates.",
        "operationId": "updateUser",
        "requestBody": {
          "description": "Update user request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/users/search": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Query users",
        "description": "Use when listing or searching service accounts in an admin UI, or when auditing who has API access and which roles they have.",
        "operationId": "queryUser",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.UserFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListUsersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/users/{id}": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update service account",
        "description": "Update a service account by ID (name only).",
        "operationId": "updateServiceAccount",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Service Account ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Update service account request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServiceAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateServiceAccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      },
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Delete service account",
        "description": "Soft-delete (archive) a service account by ID.",
        "operationId": "deleteServiceAccount",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Service Account ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content",
            "content": {}
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/users/{id}/roles": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update user roles",
        "description": "Update the roles of a user account (not service accounts \u2014 their roles are fixed at creation). Restricted to super_admin; a caller cannot update their own roles. Blocked with a 400 if the user has any active (published, unexpired) API key in any environment, since a key's permissions are snapshotted at creation time and would otherwise silently keep running on the old roles; the error lists the active keys grouped by environment ID so the caller can prompt to expire them first, then retry.",
        "operationId": "updateUserRoles",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Update user roles request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRolesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateUserRolesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, or user has active API keys that must be expired first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/v1/subscription-schedules": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "List all subscription schedules",
        "description": "Use when listing or searching scheduled changes across subscriptions (e.g. admin view). Returns schedules with optional filtering.",
        "operationId": "listAllSubscriptionSchedules",
        "parameters": [
          {
            "name": "pending_only",
            "in": "query",
            "description": "Filter to pending schedules only",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "subscription_id",
            "in": "query",
            "description": "Filter by subscription ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Limit results",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Offset for pagination",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPendingSchedulesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/subscription-schedules/{id}": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get subscription schedule",
        "description": "Use when you need to load a single scheduled change (e.g. to show when a plan change or renewal takes effect).",
        "operationId": "getSubscriptionSchedule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Schedule ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionScheduleResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/subscriptions/schedules/{schedule_id}/cancel": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Cancel subscription schedule",
        "description": "Use when cancelling a scheduled change (e.g. customer changed mind). Identify by schedule ID in path or by subscription ID + schedule type in body.",
        "operationId": "cancelSubscriptionSchedule",
        "parameters": [
          {
            "name": "schedule_id",
            "in": "path",
            "description": "Schedule ID (optional if using request body)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Cancel request (optional if using path parameter)",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelScheduleRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelScheduleResponse"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "request"
      }
    },
    "/v1/subscriptions/{subscription_id}/schedules": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "List subscription schedules",
        "description": "Use when listing scheduled changes for a subscription (e.g. upcoming plan change or renewal). Returns all schedules for that subscription.",
        "operationId": "listSubscriptionSchedules",
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "description": "Subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPendingSchedulesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets": {
      "post": {
        "tags": [
          "Wallets"
        ],
        "summary": "Create a new wallet",
        "description": "Use when giving a customer a prepaid or credit balance (e.g. prepaid plans or promotional credits).",
        "operationId": "createWallet",
        "requestBody": {
          "description": "Create wallet request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWalletRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/wallets/search": {
      "post": {
        "tags": [
          "Wallets"
        ],
        "summary": "Query wallets",
        "description": "Use when listing or searching wallets (e.g. admin view or reporting). Returns a paginated list; supports filtering by customer and status.",
        "operationId": "queryWallet",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.WalletFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/types.ListResponse-dto_WalletResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/wallets/transactions/search": {
      "post": {
        "tags": [
          "Wallets"
        ],
        "summary": "Query wallet transactions",
        "description": "Use when searching or reporting on wallet transactions (e.g. cross-wallet history or reconciliation). Returns a paginated list; supports filtering by wallet, customer, type, date range.",
        "operationId": "queryWalletTransaction",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.WalletTransactionFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWalletTransactionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    },
    "/wallets/{id}": {
      "get": {
        "tags": [
          "Wallets"
        ],
        "summary": "Get wallet",
        "description": "Use when you need to load a single wallet (e.g. for a balance or settings view).",
        "operationId": "getWallet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Wallet ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Wallets"
        ],
        "summary": "Update a wallet",
        "description": "Use when changing wallet settings (e.g. enabling or updating auto top-up thresholds).",
        "operationId": "updateWallet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Wallet ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Update wallet request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWalletRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/wallets/{id}/balance/real-time": {
      "get": {
        "tags": [
          "Wallets"
        ],
        "summary": "Get wallet balance",
        "description": "Use when displaying or checking current wallet balance (e.g. before charging or in a portal). Supports optional expand for credits breakdown and from_cache.",
        "operationId": "getWalletBalance",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Wallet ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "Expand fields (e.g., credits_available_breakdown)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletBalanceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/wallets/{id}/terminate": {
      "post": {
        "tags": [
          "Wallets"
        ],
        "summary": "Terminate a wallet",
        "description": "Use when closing a customer wallet (e.g. churn or migration). Closes the wallet and applies remaining balance per policy (refund or forfeit).",
        "operationId": "terminateWallet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Wallet ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/wallets/{id}/top-up": {
      "post": {
        "tags": [
          "Wallets"
        ],
        "summary": "Top up wallet",
        "description": "Use when adding funds to a wallet (e.g. top-up, refund, or manual credit). Supports optional idempotency via reference.",
        "operationId": "topUpWallet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Wallet ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Top up request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TopUpWalletRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopUpWalletResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "request"
      }
    },
    "/wallets/{id}/transactions": {
      "get": {
        "tags": [
          "Wallets"
        ],
        "summary": "Get wallet transactions",
        "description": "Use when showing transaction history for a wallet (e.g. credit/debit log or audit). Returns a paginated list; supports limit, offset, and filters.",
        "operationId": "getWalletTransactions",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Wallet ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_by",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "credits_available_gt",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "end_time",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expiry_date_after",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expiry_date_before",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "priority",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "reference_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reference_type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_time",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "published",
                "deleted",
                "archived"
              ],
              "x-enum-varnames": [
                "StatusPublished",
                "StatusDeleted",
                "StatusArchived"
              ]
            },
            "x-enum-varnames": [
              "StatusPublished",
              "StatusDeleted",
              "StatusArchived"
            ]
          },
          {
            "name": "transaction_reason",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "INVOICE_PAYMENT",
                "FREE_CREDIT_GRANT",
                "SUBSCRIPTION_CREDIT_GRANT",
                "PURCHASED_CREDIT_INVOICED",
                "PURCHASED_CREDIT_DIRECT",
                "CREDIT_NOTE",
                "CREDIT_EXPIRED",
                "WALLET_TERMINATION",
                "MANUAL_BALANCE_DEBIT",
                "CREDIT_ADJUSTMENT",
                "INVOICE_VOID_REFUND",
                "PURCHASED_CREDIT_BONUS"
              ],
              "x-enum-varnames": [
                "TransactionReasonInvoicePayment",
                "TransactionReasonFreeCredit",
                "TransactionReasonSubscriptionCredit",
                "TransactionReasonPurchasedCreditInvoiced",
                "TransactionReasonPurchasedCreditDirect",
                "TransactionReasonCreditNote",
                "TransactionReasonCreditExpired",
                "TransactionReasonWalletTermination",
                "TransactionReasonManualBalanceDebit",
                "TransactionReasonCreditAdjustment",
                "TransactionReasonInvoiceVoidRefund",
                "TransactionReasonPurchasedCreditBonus"
              ]
            },
            "x-enum-varnames": [
              "TransactionReasonInvoicePayment",
              "TransactionReasonFreeCredit",
              "TransactionReasonSubscriptionCredit",
              "TransactionReasonPurchasedCreditInvoiced",
              "TransactionReasonPurchasedCreditDirect",
              "TransactionReasonCreditNote",
              "TransactionReasonCreditExpired",
              "TransactionReasonWalletTermination",
              "TransactionReasonManualBalanceDebit",
              "TransactionReasonCreditAdjustment",
              "TransactionReasonInvoiceVoidRefund",
              "TransactionReasonPurchasedCreditBonus"
            ]
          },
          {
            "name": "transaction_status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "completed",
                "failed"
              ],
              "x-enum-varnames": [
                "TransactionStatusPending",
                "TransactionStatusCompleted",
                "TransactionStatusFailed"
              ]
            },
            "x-enum-varnames": [
              "TransactionStatusPending",
              "TransactionStatusCompleted",
              "TransactionStatusFailed"
            ]
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "credit",
                "debit"
              ],
              "x-enum-varnames": [
                "TransactionTypeCredit",
                "TransactionTypeDebit"
              ]
            },
            "x-enum-varnames": [
              "TransactionTypeCredit",
              "TransactionTypeDebit"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWalletTransactionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/webhook-events/checkout.session.completed": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "checkout.session.completed",
        "description": "Fired when payment is confirmed; the subscription is now active and the invoice is finalized. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.CheckoutSessionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/checkout.session.expired": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "checkout.session.expired",
        "description": "Fired when a Checkout Session times out without payment; draft records are cleaned up. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.CheckoutSessionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/checkout.session.failed": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "checkout.session.failed",
        "description": "Fired when payment fails or the provider cancels the payment link. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.CheckoutSessionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/checkout.session.initiated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "checkout.session.initiated",
        "description": "Fired when a Checkout Session is created and a payment URL is returned to the customer. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.CheckoutSessionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/credit_note.created": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "credit_note.created",
        "description": "Fired when a new credit note is created. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.CreditNoteWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/credit_note.updated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "credit_note.updated",
        "description": "Fired when a credit note is updated. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.CreditNoteWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/customer.created": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "customer.created",
        "description": "Fired when a new customer is created. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.CustomerWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/customer.deleted": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "customer.deleted",
        "description": "Fired when a customer is deleted. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.CustomerWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/customer.updated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "customer.updated",
        "description": "Fired when a customer is updated. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.CustomerWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/entitlement.created": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "entitlement.created",
        "description": "Fired when a new entitlement is created. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.EntitlementWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/entitlement.deleted": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "entitlement.deleted",
        "description": "Fired when an entitlement is deleted. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.EntitlementWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/entitlement.updated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "entitlement.updated",
        "description": "Fired when an entitlement is updated. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.EntitlementWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/event.rejected": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "event.rejected",
        "description": "Fired when an ingested usage event produces no meter usage \u2014 either no meter is registered for its event name, or meters exist for the name but the event matched none of their filters. Throttled to at most once per configured window per event name. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.RejectedEventWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/feature.created": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "feature.created",
        "description": "Fired when a new feature is created. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.FeatureWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/feature.deleted": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "feature.deleted",
        "description": "Fired when a feature is deleted. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.FeatureWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/feature.updated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "feature.updated",
        "description": "Fired when a feature is updated. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.FeatureWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/feature.wallet_balance.alert": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "feature.wallet_balance.alert",
        "description": "Fired when a feature's associated wallet balance crosses an alert threshold. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.AlertWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/invoice.communication.triggered": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "invoice.communication.triggered",
        "description": "Fired when an invoice communication (e.g. email notification) is triggered. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.CommunicationWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/invoice.create.drafted": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "invoice.create.drafted",
        "description": "Fired when a new invoice is created in draft state. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.InvoiceWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/invoice.payment.overdue": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "invoice.payment.overdue",
        "description": "Fired when an invoice payment is overdue past the due date. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.InvoiceWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/invoice.update": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "invoice.update",
        "description": "Fired when an invoice is updated. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.InvoiceWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/invoice.update.finalized": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "invoice.update.finalized",
        "description": "Fired when an invoice is finalized and locked for payment. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.InvoiceWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/invoice.update.payment": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "invoice.update.payment",
        "description": "Fired when an invoice payment status changes. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.InvoiceWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/invoice.update.voided": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "invoice.update.voided",
        "description": "Fired when an invoice is voided (e.g. order cancelled or duplicate). Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.InvoiceWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/payment.created": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "payment.created",
        "description": "Fired when a new payment is created. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.PaymentWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/payment.failed": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "payment.failed",
        "description": "Fired when a payment fails. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.PaymentWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/payment.pending": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "payment.pending",
        "description": "Fired when a payment is pending processing. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.PaymentWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/payment.success": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "payment.success",
        "description": "Fired when a payment succeeds. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.PaymentWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/payment.updated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "payment.updated",
        "description": "Fired when a payment is updated. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.PaymentWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.activated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.activated",
        "description": "Fired when a draft subscription is activated. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.cancelled": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.cancelled",
        "description": "Fired when a subscription is cancelled (immediately or end-of-period). Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.created": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.created",
        "description": "Fired when a new subscription is created. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.draft.created": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.draft.created",
        "description": "Fired when a new draft subscription is created (not yet activated). Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.group_spend.threshold_reached": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.group_spend.threshold_reached",
        "description": "Fired when a feature group's total metered spend on a subscription crosses an alert threshold (critical, warning, or info) for the current billing period. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SpendAlertEvent"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.group_spend.threshold_recovered": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.group_spend.threshold_recovered",
        "description": "Fired when a feature group's total metered spend on a subscription falls back below all configured alert thresholds for the current billing period. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SpendAlertEvent"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.line_item_spend.threshold_reached": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.line_item_spend.threshold_reached",
        "description": "Fired when a subscription line item's metered spend crosses an alert threshold (critical, warning, or info) for the current billing period. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SpendAlertEvent"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.line_item_spend.threshold_recovered": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.line_item_spend.threshold_recovered",
        "description": "Fired when a subscription line item's metered spend falls back below all configured alert thresholds for the current billing period. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SpendAlertEvent"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.paused": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.paused",
        "description": "Fired when a subscription is paused. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.phase.created": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.phase.created",
        "description": "Fired when a new subscription phase is created. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionPhaseWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.phase.deleted": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.phase.deleted",
        "description": "Fired when a subscription phase is deleted. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionPhaseWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.phase.updated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.phase.updated",
        "description": "Fired when a subscription phase is updated. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionPhaseWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.plan_changed": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.plan_changed",
        "description": "Fired when a subscription plan changes in place (id/anchor preserved; not cancelled+created). Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.renewal.due": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.renewal.due",
        "description": "Fired when a subscription renewal is upcoming (cron-driven). Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.resumed": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.resumed",
        "description": "Fired when a paused subscription is resumed. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.spend.threshold_reached": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.spend.threshold_reached",
        "description": "Fired when a subscription's total metered spend crosses an alert threshold (critical, warning, or info) for the current billing period. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SpendAlertEvent"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.spend.threshold_recovered": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.spend.threshold_recovered",
        "description": "Fired when a subscription's total metered spend falls back below all configured alert thresholds for the current billing period. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SpendAlertEvent"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/subscription.updated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "subscription.updated",
        "description": "Fired when a subscription is updated (e.g. quantity, billing anchor, or metadata changes). Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/wallet.created": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "wallet.created",
        "description": "Fired when a new wallet is created. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/wallet.credit_balance.dropped": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "wallet.credit_balance.dropped",
        "description": "Fired when a wallet's credit balance drops below an alert threshold. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/wallet.credit_balance.recovered": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "wallet.credit_balance.recovered",
        "description": "Fired when a wallet's credit balance recovers above an alert threshold. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/wallet.ongoing_balance.dropped": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "wallet.ongoing_balance.dropped",
        "description": "Fired when a wallet's ongoing balance drops below an alert threshold. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/wallet.ongoing_balance.recovered": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "wallet.ongoing_balance.recovered",
        "description": "Fired when a wallet's ongoing balance recovers above an alert threshold. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/wallet.ongoing_balance.updated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "wallet.ongoing_balance.updated",
        "description": "Fired when a wallet's ongoing (real-time) balance changes. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/wallet.terminated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "wallet.terminated",
        "description": "Fired when a wallet is terminated. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/wallet.transaction.created": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "wallet.transaction.created",
        "description": "Fired when a new wallet transaction is created (top-up, deduction, etc.). Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.TransactionWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/wallet.transaction.updated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "wallet.transaction.updated",
        "description": "Fired when an existing wallet transaction is updated (e.g. pending to completed). Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.TransactionUpdatedWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/webhook-events/wallet.updated": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "wallet.updated",
        "description": "Fired when a wallet is updated. Doc-only for parsing.",
        "responses": {
          "200": {
            "description": "Webhook payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload"
                }
              }
            }
          }
        }
      }
    },
    "/workflows/search": {
      "post": {
        "tags": [
          "Workflows"
        ],
        "summary": "Query workflows",
        "description": "Use when listing or auditing workflow runs (e.g. ops dashboard or debugging). Returns a paginated list; supports filtering by workflow type and status.",
        "operationId": "queryWorkflow",
        "requestBody": {
          "description": "Filter",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/types.WorkflowExecutionFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWorkflowsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors.ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-codegen-request-body-name": "filter"
      }
    }
  },
  "components": {
    "schemas": {
      "ListAddonsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddonResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListAlertSettingsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertSettingsResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListCouponsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CouponResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListCreditGrantApplicationsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditGrantApplicationResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListCreditGrantsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditGrantResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListCustomersResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        },
        "description": "Response object for listing customers with pagination"
      },
      "ListEntitlementsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntitlementResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListFeaturesResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeatureResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListGroupsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListInvoicesResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListPlansResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListPriceUnitsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceUnitResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListPricesResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListScheduledTasksResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduledTaskResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListSubscriptionLineItemsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionLineItemResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListSubscriptionsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListTaxAssociationsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxAssociationResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListUsersResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListWalletTransactionsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WalletTransactionResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListWorkflowsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowExecutionDTO"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "checkout.JSONBCheckoutConfiguration": {
        "type": "object",
        "properties": {
          "add_addon_params": {
            "$ref": "#/components/schemas/types.AddAddonParams"
          },
          "create_subscription_params": {
            "$ref": "#/components/schemas/types.CreateSubscriptionParams"
          },
          "modify_subscription_params": {
            "$ref": "#/components/schemas/types.ModifySubscriptionParams"
          },
          "wallet_topup_params": {
            "$ref": "#/components/schemas/types.WalletTopupParams"
          }
        }
      },
      "checkout.JSONBCheckoutPaymentProviderConfig": {
        "type": "object",
        "properties": {
          "collection_method": {
            "$ref": "#/components/schemas/types.CollectionMethod"
          },
          "max_mandate_limit": {
            "type": "string"
          },
          "payment_method": {
            "$ref": "#/components/schemas/types.PaymentMethodType"
          }
        }
      },
      "checkout.JSONBCheckoutProviderResult": {
        "type": "object",
        "properties": {
          "expires_at": {
            "type": "string",
            "description": "ExpiresAt is the provider URL expiry. When set and earlier than the session expiry,\nexecuteCheckoutAction tightens the session expiry to match.",
            "format": "date-time"
          },
          "next_action": {
            "$ref": "#/components/schemas/types.PaymentAction"
          },
          "provider_metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "ProviderMetadata holds provider-specific data not needed for business logic."
          },
          "provider_payment_intent_id": {
            "type": "string",
            "description": "ProviderPaymentIntentID is the provider-side charge/intent ID.\nStripe returns this at link creation (pi_xxx); others populate it from the webhook payload."
          },
          "provider_session_id": {
            "type": "string",
            "description": "ProviderSessionID is stored in EntityIntegrationMapping at link creation.\n  Stripe:   Checkout Session ID  (cs_xxx)\n  Razorpay: Payment Link ID      (plink_xxx)\n  Nomod:    Payment Link ID      (NOTE: webhook uses Charge ID; look up by PaymentLinkID field)\n  Moyasar:  Payment ID"
          }
        }
      },
      "checkout.JSONBCheckoutResult": {
        "type": "object",
        "properties": {
          "create_subscription_result": {
            "$ref": "#/components/schemas/types.CreateSubscriptionResult"
          }
        }
      },
      "costsheet.Filter": {
        "type": "object",
        "properties": {
          "costsheetIDs": {
            "type": "array",
            "description": "CostsheetIDs allows filtering by specific costsheet IDs",
            "items": {
              "type": "string"
            }
          },
          "environmentID": {
            "type": "string",
            "description": "EnvironmentID filters by specific environment ID"
          },
          "filters": {
            "type": "array",
            "description": "Filters contains custom filtering conditions",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "lookupKey": {
            "type": "string",
            "description": "LookupKey filters by lookup key"
          },
          "name": {
            "type": "string",
            "description": "Name filters by costsheet name"
          },
          "queryFilter": {
            "$ref": "#/components/schemas/types.QueryFilter"
          },
          "sort": {
            "type": "array",
            "description": "Sort specifies result ordering preferences",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenantID": {
            "type": "string",
            "description": "TenantID filters by specific tenant ID"
          },
          "timeRangeFilter": {
            "$ref": "#/components/schemas/types.TimeRangeFilter"
          }
        }
      },
      "coupon_application.CouponApplication": {
        "type": "object",
        "properties": {
          "applied_at": {
            "type": "string",
            "format": "date-time"
          },
          "coupon_association_id": {
            "type": "string"
          },
          "coupon_id": {
            "type": "string"
          },
          "coupon_snapshot": {
            "type": "object",
            "additionalProperties": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "discount_percentage": {
            "type": "string"
          },
          "discount_type": {
            "$ref": "#/components/schemas/types.CouponType"
          },
          "discounted_amount": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "final_price": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invoice_id": {
            "type": "string"
          },
          "invoice_line_item_id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "original_price": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "coupon_association.CouponAssociation": {
        "type": "object",
        "properties": {
          "coupon": {
            "$ref": "#/components/schemas/Coupon"
          },
          "coupon_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "description": "Optional",
            "format": "date-time"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string",
            "description": "Mandatory"
          },
          "subscription_line_item_id": {
            "type": "string",
            "description": "Optional"
          },
          "subscription_phase_id": {
            "type": "string",
            "description": "Optional"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "creditnote.CreditNoteLineItem": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "credit_note_id": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invoice_line_item_id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "AWSMarketplaceAgreement": {
        "required": [
          "customer_aws_account_id",
          "dimension",
          "license_arn",
          "product_code"
        ],
        "type": "object",
        "properties": {
          "concurrent_agreements": {
            "type": "boolean",
            "description": "if true, ProductCode is omitted when reporting"
          },
          "customer_aws_account_id": {
            "type": "string",
            "description": "-> BatchMeterUsage's CustomerAWSAccountId"
          },
          "dimension": {
            "type": "string",
            "description": "-> BatchMeterUsage's Dimension (always \"usage_fee\" in the cents model)"
          },
          "license_arn": {
            "type": "string",
            "description": "-> BatchMeterUsage's LicenseArn; identifies the buyer's agreement"
          },
          "product_code": {
            "type": "string",
            "description": "-> BatchMeterUsage's ProductCode (omitted when ConcurrentAgreements)"
          }
        }
      },
      "ActivateDraftSubscriptionRequest": {
        "required": [
          "start_date"
        ],
        "type": "object",
        "properties": {
          "start_date": {
            "type": "string",
            "description": "start_date is the new start date for the subscription when activating",
            "format": "date-time"
          }
        }
      },
      "AddAddonRequest": {
        "required": [
          "addon_id",
          "subscription_id"
        ],
        "type": "object",
        "properties": {
          "addon_id": {
            "type": "string"
          },
          "cadence": {
            "$ref": "#/components/schemas/types.AddonCadence"
          },
          "checkout": {
            "$ref": "#/components/schemas/CheckoutParams"
          },
          "line_item_commitments": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/LineItemCommitmentConfig"
            },
            "description": "LineItemCommitments allows setting commitment configuration per addon line item (keyed by price_id)"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "override_line_items": {
            "type": "array",
            "description": "OverrideLineItems allows overriding price/quantity/billing model for specific addon prices",
            "items": {
              "$ref": "#/components/schemas/OverrideLineItemRequest"
            }
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "subscription_id": {
            "type": "string"
          }
        }
      },
      "AddAddonToSubscriptionRequest": {
        "required": [
          "addon_id"
        ],
        "type": "object",
        "properties": {
          "addon_id": {
            "type": "string"
          },
          "cadence": {
            "$ref": "#/components/schemas/types.AddonCadence"
          },
          "line_item_commitments": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/LineItemCommitmentConfig"
            },
            "description": "LineItemCommitments allows setting commitment configuration per addon line item (keyed by price_id)"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "override_line_items": {
            "type": "array",
            "description": "OverrideLineItems allows overriding price/quantity/billing model for specific addon prices",
            "items": {
              "$ref": "#/components/schemas/OverrideLineItemRequest"
            }
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AddAddonToSubscriptionResponse": {
        "type": "object",
        "properties": {
          "addon_id": {
            "type": "string"
          },
          "addon_status": {
            "$ref": "#/components/schemas/types.AddonStatus"
          },
          "cancellation_reason": {
            "type": "string"
          },
          "cancelled_at": {
            "type": "string",
            "format": "date-time"
          },
          "checkout_session": {
            "$ref": "#/components/schemas/CheckoutSessionResponse"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.AddonAssociationEntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invoice": {
            "$ref": "#/components/schemas/InvoiceResponse"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "AddonAssociationResponse": {
        "type": "object",
        "properties": {
          "addon": {
            "$ref": "#/components/schemas/AddonResponse"
          },
          "addon_id": {
            "type": "string"
          },
          "addon_status": {
            "$ref": "#/components/schemas/types.AddonStatus"
          },
          "cancellation_reason": {
            "type": "string"
          },
          "cancelled_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.AddonAssociationEntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription": {
            "$ref": "#/components/schemas/SubscriptionResponse"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "AddonResponse": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "credit_grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditGrantResponse"
            }
          },
          "description": {
            "type": "string"
          },
          "entitlements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntitlementResponse"
            }
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "name": {
            "type": "string"
          },
          "prices": {
            "type": "array",
            "description": "Optional expanded fields",
            "items": {
              "$ref": "#/components/schemas/PriceResponse"
            }
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "Address": {
        "type": "object",
        "properties": {
          "address_city": {
            "maxLength": 100,
            "type": "string"
          },
          "address_country": {
            "type": "string"
          },
          "address_line1": {
            "maxLength": 255,
            "type": "string"
          },
          "address_line2": {
            "maxLength": 255,
            "type": "string"
          },
          "address_postal_code": {
            "maxLength": 20,
            "type": "string"
          },
          "address_state": {
            "maxLength": 100,
            "type": "string"
          }
        }
      },
      "AggregatedEntitlement": {
        "type": "object",
        "properties": {
          "aggregation_mode": {
            "$ref": "#/components/schemas/types.EntitlementAggregationMode"
          },
          "buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AggregatedEntitlementBucket"
            }
          },
          "config_values": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "object"
              }
            }
          },
          "is_enabled": {
            "type": "boolean"
          },
          "is_soft_limit": {
            "type": "boolean"
          },
          "static_values": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "usage_limit": {
            "type": "integer"
          },
          "usage_reset_period": {
            "$ref": "#/components/schemas/types.EntitlementUsageResetPeriod"
          }
        }
      },
      "AggregatedEntitlementBucket": {
        "type": "object",
        "properties": {
          "entitlement_id": {
            "type": "string"
          },
          "grant_duration_unit": {
            "$ref": "#/components/schemas/types.EntitlementGrantDurationUnit"
          },
          "grant_duration_value": {
            "type": "integer"
          },
          "grant_measure": {
            "$ref": "#/components/schemas/types.EntitlementGrantMeasure"
          },
          "grant_quota": {
            "type": "string"
          },
          "source_entity_id": {
            "type": "string"
          },
          "usage_limit": {
            "type": "integer"
          }
        }
      },
      "AggregatedFeature": {
        "type": "object",
        "properties": {
          "entitlement": {
            "$ref": "#/components/schemas/AggregatedEntitlement"
          },
          "feature": {
            "$ref": "#/components/schemas/FeatureResponse"
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntitlementSource"
            }
          }
        }
      },
      "AlertLogResponse": {
        "type": "object",
        "properties": {
          "alert_info": {
            "$ref": "#/components/schemas/types.AlertInfo"
          },
          "alert_status": {
            "$ref": "#/components/schemas/types.AlertState"
          },
          "alert_type": {
            "$ref": "#/components/schemas/types.AlertType"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "customer": {
            "$ref": "#/components/schemas/CustomerResponse"
          },
          "customer_id": {
            "type": "string"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.AlertEntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "feature": {
            "$ref": "#/components/schemas/FeatureResponse"
          },
          "id": {
            "type": "string"
          },
          "parent_entity_id": {
            "type": "string"
          },
          "parent_entity_type": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "wallet": {
            "$ref": "#/components/schemas/WalletResponse"
          }
        }
      },
      "AlertSettingsResponse": {
        "type": "object",
        "properties": {
          "config": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.AlertEntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "parent_entity_id": {
            "type": "string"
          },
          "parent_entity_type": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "AttributedToCustomerResult": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/errors.ErrorResponse"
          },
          "meter_usage": {
            "$ref": "#/components/schemas/MeterUsageAttribution"
          },
          "status": {
            "$ref": "#/components/schemas/types.DebugTrackerStatus"
          }
        }
      },
      "AzureMarketplaceAgreement": {
        "required": [
          "beneficiary_account_id",
          "dimension",
          "plan_id",
          "resource_id"
        ],
        "type": "object",
        "properties": {
          "beneficiary_account_id": {
            "type": "string",
            "description": "writes the customer mapping; not read in the report payload"
          },
          "dimension": {
            "type": "string",
            "description": "-> usageEvent's dimension (always \"usage_fee\" in the cents model)"
          },
          "plan_id": {
            "type": "string",
            "description": "-> usageEvent's planId; Azure's plan id, distinct from the request's top-level PlanID"
          },
          "resource_id": {
            "type": "string",
            "description": "-> usageEvent's resourceId; the Azure SaaS subscription id"
          }
        }
      },
      "BillingCycleInfo": {
        "type": "object",
        "properties": {
          "billing_anchor": {
            "type": "string",
            "description": "billing_anchor is the new billing anchor",
            "format": "date-time"
          },
          "billing_cadence": {
            "$ref": "#/components/schemas/types.BillingCadence"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer",
            "description": "billing_period_count is the billing period count"
          },
          "period_end": {
            "type": "string",
            "description": "period_end is the end of the new billing period",
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "description": "period_start is the start of the new billing period",
            "format": "date-time"
          }
        }
      },
      "BillingPeriodInfo": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "period": {
            "type": "string",
            "description": "e.g., \"monthly\", \"yearly\""
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BucketSummary": {
        "type": "object",
        "properties": {
          "base_charge": {
            "type": "string"
          },
          "bucket_id": {
            "type": "string"
          },
          "commitment_type": {
            "type": "string"
          },
          "commitment_value": {
            "type": "string"
          },
          "computed_overage": {
            "type": "string"
          },
          "computed_true_up": {
            "type": "string"
          },
          "computed_utilized": {
            "type": "string"
          },
          "end": {
            "$ref": "#/components/schemas/types.Bucket"
          },
          "price_id": {
            "type": "string",
            "description": "PriceID is the bucket's own price (the line item's price for the\nout-of-bucket row)."
          },
          "start": {
            "$ref": "#/components/schemas/types.Bucket"
          },
          "subscription_line_item_id": {
            "type": "string",
            "description": "SubscriptionLineItemID is the line item this bucket is configured on."
          },
          "total_usage": {
            "type": "string"
          }
        }
      },
      "BulkIngestEventRequest": {
        "required": [
          "events"
        ],
        "type": "object",
        "properties": {
          "events": {
            "maxItems": 1000,
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IngestEventRequest"
            }
          }
        }
      },
      "CancelScheduleRequest": {
        "type": "object",
        "properties": {
          "schedule_id": {
            "type": "string",
            "description": "schedule_id is the ID of the schedule to cancel (optional if subscription_id and schedule_type are provided)"
          },
          "schedule_type": {
            "$ref": "#/components/schemas/types.SubscriptionScheduleChangeType"
          },
          "subscription_id": {
            "type": "string",
            "description": "subscription_id is the ID of the subscription (required if schedule_id is not provided)"
          }
        },
        "description": "Request to cancel a subscription schedule (supports two modes)"
      },
      "CancelScheduleResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "message is a confirmation message"
          },
          "status": {
            "$ref": "#/components/schemas/types.ScheduleStatus"
          }
        },
        "description": "Confirmation of schedule cancellation"
      },
      "CancelSubscriptionRequest": {
        "required": [
          "cancellation_type"
        ],
        "type": "object",
        "properties": {
          "cancel_at": {
            "type": "string",
            "description": "CancelAt is the exact date/time when the subscription should be cancelled.\nRequired for cancellation_type \"scheduled_date\"; optional for \"immediate\" (past dates only \u2014 backdated cancellation).\nFor \"scheduled_date\", accepts both future dates (deferred cancellation) and past dates (backdated cancellation).\nFor \"immediate\", accepts past/current dates only; use \"scheduled_date\" for future dates.",
            "format": "date-time"
          },
          "cancel_immediately_inovice_policy": {
            "$ref": "#/components/schemas/types.CancelImmediatelyInvoicePolicy"
          },
          "cancellation_type": {
            "$ref": "#/components/schemas/types.CancellationType"
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          },
          "reason": {
            "type": "string",
            "description": "Reason for cancellation (for audit and business intelligence)"
          }
        }
      },
      "CancelSubscriptionResponse": {
        "type": "object",
        "properties": {
          "cancellation_type": {
            "$ref": "#/components/schemas/types.CancellationType"
          },
          "effective_date": {
            "type": "string",
            "format": "date-time"
          },
          "message": {
            "type": "string",
            "description": "Response metadata"
          },
          "processed_at": {
            "type": "string",
            "format": "date-time"
          },
          "proration_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProrationDetail"
            }
          },
          "proration_invoice": {
            "$ref": "#/components/schemas/InvoiceResponse"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.SubscriptionStatus"
          },
          "subscription_id": {
            "type": "string",
            "description": "Basic cancellation info"
          },
          "total_credit_amount": {
            "type": "string"
          }
        }
      },
      "ChangedInvoice": {
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/ChangedInvoiceAction"
          },
          "id": {
            "type": "string"
          },
          "invoice": {
            "$ref": "#/components/schemas/InvoiceResponse"
          },
          "status": {
            "$ref": "#/components/schemas/ChangedInvoiceStatus"
          },
          "wallet_transaction": {
            "$ref": "#/components/schemas/WalletTransactionResponse"
          }
        }
      },
      "ChangedInvoiceAction": {
        "type": "string",
        "description": "created (proration invoice) | wallet_credit (downgrade credit)",
        "enum": [
          "created",
          "wallet_credit"
        ],
        "x-enum-varnames": [
          "ChangedInvoiceActionCreated",
          "ChangedInvoiceActionWalletCredit"
        ]
      },
      "ChangedInvoiceStatus": {
        "type": "string",
        "description": "preview | issued | INITIATED | PENDING | PROCESSING | SUCCEEDED | OVERPAID | FAILED | REFUNDED | PARTIALLY_REFUNDED",
        "enum": [
          "preview",
          "issued"
        ],
        "x-enum-varnames": [
          "ChangedInvoiceStatusPreview",
          "ChangedInvoiceStatusWalletIssued"
        ]
      },
      "ChangedLineItem": {
        "type": "object",
        "properties": {
          "change_action": {
            "$ref": "#/components/schemas/ChangedLineItemAction"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "price_id": {
            "type": "string"
          },
          "quantity": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ChangedLineItemAction": {
        "type": "string",
        "description": "created | updated | ended",
        "enum": [
          "created",
          "updated",
          "ended"
        ],
        "x-enum-varnames": [
          "ChangedLineItemActionCreated",
          "ChangedLineItemActionUpdated",
          "ChangedLineItemActionEnded"
        ]
      },
      "ChangedResources": {
        "type": "object",
        "properties": {
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChangedInvoice"
            }
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChangedLineItem"
            }
          },
          "subscriptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChangedSubscription"
            }
          }
        }
      },
      "ChangedSubscription": {
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/ChangedSubscriptionAction"
          },
          "current_period_end": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.SubscriptionStatus"
          },
          "trial_end": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ChangedSubscriptionAction": {
        "type": "string",
        "description": "created | updated",
        "enum": [
          "created",
          "updated"
        ],
        "x-enum-varnames": [
          "ChangedSubscriptionActionCreated",
          "ChangedSubscriptionActionUpdated"
        ]
      },
      "CheckoutParams": {
        "required": [
          "payment_provider"
        ],
        "type": "object",
        "properties": {
          "cancel_url": {
            "type": "string"
          },
          "failure_url": {
            "type": "string"
          },
          "idempotency_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "payment_provider": {
            "$ref": "#/components/schemas/types.CheckoutPaymentProvider"
          },
          "payment_provider_config": {
            "$ref": "#/components/schemas/types.CheckoutPaymentProviderConfig"
          },
          "success_url": {
            "type": "string"
          }
        }
      },
      "CheckoutSessionResponse": {
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/types.CheckoutAction"
          },
          "cancel_url": {
            "type": "string"
          },
          "cancelled_at": {
            "type": "string",
            "format": "date-time"
          },
          "checkout_invoice_id": {
            "type": "string",
            "description": "CheckoutInvoiceID and CheckoutPaymentID are set once the apply step\ncreates the corresponding Flexprice entities (completed sessions only)."
          },
          "checkout_payment_id": {
            "type": "string"
          },
          "checkout_status": {
            "$ref": "#/components/schemas/types.CheckoutStatus"
          },
          "completed_at": {
            "type": "string",
            "format": "date-time"
          },
          "configuration": {
            "$ref": "#/components/schemas/checkout.JSONBCheckoutConfiguration"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "description": "ExpiresAt is required. A Temporal timer fires at this time for any\nsession still in initiated|pending, marking it expired. The caller\nmust create a new session after expiry (expire-and-restart model).",
            "format": "date-time"
          },
          "failure_reason": {
            "type": "string",
            "description": "FailureReason is a human-readable string set on failed sessions."
          },
          "failure_url": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "idempotency_key": {
            "type": "string",
            "description": "IdempotencyKey is caller-supplied. It is unique only while the session\nis active (initiated|pending). The same key may be reused once the\nsession reaches a terminal state (completed|failed|expired)."
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "payment_action": {
            "$ref": "#/components/schemas/types.PaymentAction"
          },
          "payment_provider": {
            "$ref": "#/components/schemas/types.CheckoutPaymentProvider"
          },
          "payment_provider_config": {
            "$ref": "#/components/schemas/checkout.JSONBCheckoutPaymentProviderConfig"
          },
          "provider_result": {
            "$ref": "#/components/schemas/checkout.JSONBCheckoutProviderResult"
          },
          "result": {
            "$ref": "#/components/schemas/checkout.JSONBCheckoutResult"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "success_url": {
            "type": "string",
            "description": "Redirect URLs sent to the payment provider. The provider redirects the\nuser browser to the appropriate URL after the payment flow completes."
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "CloneEnvironmentRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the new environment (required when target_environment_id is not provided)"
          },
          "target_environment_id": {
            "type": "string",
            "description": "TargetEnvironmentID is the ID of an existing environment to clone into (optional).\nWhen provided, Name and Type are ignored. When omitted, Name and Type are required."
          },
          "type": {
            "$ref": "#/components/schemas/types.EnvironmentType"
          }
        }
      },
      "CloneFeatureRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Description overrides the source feature's description when provided"
          },
          "lookup_key": {
            "type": "string",
            "description": "LookupKey is required and must be unique across published features"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string",
            "description": "Name is required and must be different from the source feature's name"
          }
        }
      },
      "ClonePlanRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Description overrides the source plan's description when provided"
          },
          "display_order": {
            "type": "integer",
            "description": "DisplayOrder overrides the source plan's display order when provided"
          },
          "lookup_key": {
            "type": "string",
            "description": "LookupKey is required and must be unique across published plans"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string",
            "description": "Name is required and must be different from the source plan's name"
          }
        }
      },
      "CommitmentBucketRequest": {
        "type": "object",
        "properties": {
          "commitment_type": {
            "$ref": "#/components/schemas/types.CommitmentType"
          },
          "commitment_value": {
            "type": "string"
          },
          "end": {
            "$ref": "#/components/schemas/types.Bucket"
          },
          "id": {
            "type": "string"
          },
          "overage_factor": {
            "type": "string"
          },
          "price": {
            "$ref": "#/components/schemas/CreatePriceRequest"
          },
          "start": {
            "$ref": "#/components/schemas/types.Bucket"
          },
          "true_up_enabled": {
            "type": "boolean"
          }
        }
      },
      "CostAnalyticItem": {
        "type": "object",
        "properties": {
          "cost_by_period": {
            "type": "array",
            "description": "Breakdown",
            "items": {
              "$ref": "#/components/schemas/CostPoint"
            }
          },
          "costsheet_id": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "description": "Metadata"
          },
          "customer_id": {
            "type": "string"
          },
          "external_customer_id": {
            "type": "string"
          },
          "meter": {
            "$ref": "#/components/schemas/meter.Meter"
          },
          "meter_id": {
            "type": "string"
          },
          "meter_name": {
            "type": "string"
          },
          "price": {
            "$ref": "#/components/schemas/price.Price"
          },
          "price_id": {
            "type": "string"
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "source": {
            "type": "string"
          },
          "total_cost": {
            "type": "string",
            "description": "Aggregated metrics"
          },
          "total_events": {
            "type": "integer"
          },
          "total_quantity": {
            "type": "string"
          }
        }
      },
      "CostPoint": {
        "type": "object",
        "properties": {
          "cost": {
            "type": "string"
          },
          "event_count": {
            "type": "integer"
          },
          "quantity": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          }
        }
      },
      "CostsheetResponse": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "prices": {
            "type": "array",
            "description": "Associated prices",
            "items": {
              "$ref": "#/components/schemas/PriceResponse"
            }
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "CouponApplicationResponse": {
        "type": "object",
        "properties": {
          "applied_at": {
            "type": "string",
            "format": "date-time"
          },
          "coupon_association_id": {
            "type": "string"
          },
          "coupon_id": {
            "type": "string"
          },
          "coupon_snapshot": {
            "type": "object",
            "additionalProperties": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "discount_percentage": {
            "type": "string"
          },
          "discount_type": {
            "$ref": "#/components/schemas/types.CouponType"
          },
          "discounted_amount": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "final_price": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invoice_id": {
            "type": "string"
          },
          "invoice_line_item_id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "original_price": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "CouponAssociationResponse": {
        "type": "object",
        "properties": {
          "coupon": {
            "$ref": "#/components/schemas/CouponResponse"
          },
          "coupon_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "description": "Optional",
            "format": "date-time"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string",
            "description": "Mandatory"
          },
          "subscription_line_item": {
            "$ref": "#/components/schemas/SubscriptionLineItemResponse"
          },
          "subscription_line_item_id": {
            "type": "string",
            "description": "Optional"
          },
          "subscription_phase_id": {
            "type": "string",
            "description": "Optional"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "CouponResponse": {
        "type": "object",
        "properties": {
          "amount_off": {
            "type": "string"
          },
          "cadence": {
            "$ref": "#/components/schemas/types.CouponCadence"
          },
          "coupon_code": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "duration_in_periods": {
            "type": "integer"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "max_redemptions": {
            "type": "integer"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "percentage_off": {
            "type": "string"
          },
          "redeem_after": {
            "type": "string"
          },
          "redeem_before": {
            "type": "string"
          },
          "rules": {
            "type": "object",
            "additionalProperties": true
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "total_redemptions": {
            "type": "integer"
          },
          "type": {
            "$ref": "#/components/schemas/types.CouponType"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "CreateAPIKeyRequest": {
        "required": [
          "name",
          "type"
        ],
        "type": "object",
        "properties": {
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "service_account_id": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/types.SecretType"
          }
        }
      },
      "CreateAPIKeyResponse": {
        "type": "object",
        "properties": {
          "api_key": {
            "type": "string"
          },
          "secret": {
            "$ref": "#/components/schemas/SecretResponse"
          }
        }
      },
      "CreateAddonRequest": {
        "required": [
          "lookup_key",
          "name"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "name": {
            "type": "string"
          }
        }
      },
      "CreateAddonResponse": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "credit_grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditGrantResponse"
            }
          },
          "description": {
            "type": "string"
          },
          "entitlements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntitlementResponse"
            }
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "name": {
            "type": "string"
          },
          "prices": {
            "type": "array",
            "description": "Optional expanded fields",
            "items": {
              "$ref": "#/components/schemas/PriceResponse"
            }
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "CreateAlertSettingsRequest": {
        "required": [
          "config",
          "entity_id",
          "entity_type"
        ],
        "type": "object",
        "properties": {
          "config": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "entity_id": {
            "type": "string",
            "description": "entity_id is the id of the monitored entity: subscription id, subscription_line_item id, or\ngroup id, matching entity_type."
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.AlertEntityType"
          },
          "parent_entity_id": {
            "type": "string",
            "description": "parent_entity_id is the subscription id that owns a line-item or group alert. Required when\nentity_type is \"subscription_line_item\" or \"group\"; omitted for subscription-level alerts."
          },
          "parent_entity_type": {
            "$ref": "#/components/schemas/types.AlertEntityType"
          }
        }
      },
      "CreateBulkEntitlementRequest": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateEntitlementRequest"
            }
          }
        }
      },
      "CreateBulkEntitlementResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntitlementResponse"
            }
          }
        }
      },
      "CreateBulkPriceRequest": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreatePriceRequest"
            }
          }
        }
      },
      "CreateBulkPriceResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceResponse"
            }
          }
        }
      },
      "CreateCheckoutSessionRequest": {
        "required": [
          "action",
          "customer_external_id",
          "payment_provider"
        ],
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/types.CheckoutAction"
          },
          "cancel_url": {
            "type": "string"
          },
          "configuration": {
            "$ref": "#/components/schemas/types.CheckoutConfiguration"
          },
          "customer_external_id": {
            "type": "string"
          },
          "failure_url": {
            "type": "string"
          },
          "idempotency_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "payment_provider": {
            "$ref": "#/components/schemas/types.CheckoutPaymentProvider"
          },
          "payment_provider_config": {
            "$ref": "#/components/schemas/types.CheckoutPaymentProviderConfig"
          },
          "success_url": {
            "type": "string"
          }
        }
      },
      "CreateCostsheetRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "lookup_key": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          }
        }
      },
      "CreateCostsheetResponse": {
        "type": "object",
        "properties": {
          "costsheet": {
            "$ref": "#/components/schemas/CostsheetResponse"
          }
        }
      },
      "CreateCouponRequest": {
        "required": [
          "cadence",
          "name",
          "type"
        ],
        "type": "object",
        "properties": {
          "amount_off": {
            "type": "string"
          },
          "cadence": {
            "$ref": "#/components/schemas/types.CouponCadence"
          },
          "coupon_code": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "duration_in_periods": {
            "type": "integer"
          },
          "max_redemptions": {
            "type": "integer"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "percentage_off": {
            "type": "string"
          },
          "redeem_after": {
            "type": "string"
          },
          "redeem_before": {
            "type": "string"
          },
          "rules": {
            "type": "object",
            "additionalProperties": true
          },
          "type": {
            "$ref": "#/components/schemas/types.CouponType"
          }
        }
      },
      "CreateCreditGrantRequest": {
        "required": [
          "cadence",
          "credits",
          "name",
          "scope"
        ],
        "type": "object",
        "properties": {
          "addon_id": {
            "type": "string"
          },
          "cadence": {
            "$ref": "#/components/schemas/types.CreditGrantCadence"
          },
          "conversion_rate": {
            "type": "string",
            "description": "amount in the currency =  number of credits * conversion_rate\nex if conversion_rate is 1, then 1 USD = 1 credit\nex if conversion_rate is 2, then 1 USD = 0.5 credits\nex if conversion_rate is 0.5, then 1 USD = 2 credits"
          },
          "credits": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "expiration_duration": {
            "type": "integer"
          },
          "expiration_duration_unit": {
            "$ref": "#/components/schemas/types.CreditGrantExpiryDurationUnit"
          },
          "expiration_type": {
            "$ref": "#/components/schemas/types.CreditGrantExpiryType"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          },
          "period": {
            "$ref": "#/components/schemas/types.CreditGrantPeriod"
          },
          "period_count": {
            "type": "integer"
          },
          "plan_id": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "scope": {
            "$ref": "#/components/schemas/types.CreditGrantScope"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "subscription_id": {
            "type": "string"
          },
          "topup_conversion_rate": {
            "type": "string",
            "description": "topup_conversion_rate is the conversion rate for the topup to the currency\nex if topup_conversion_rate is 1, then 1 USD = 1 credit\nex if topup_conversion_rate is 2, then 1 USD = 0.5 credits\nex if topup_conversion_rate is 0.5, then 1 USD = 2 credits"
          }
        }
      },
      "CreateCreditNoteLineItemRequest": {
        "required": [
          "amount",
          "invoice_line_item_id"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "amount is the monetary amount to be credited for this line item"
          },
          "display_name": {
            "type": "string",
            "description": "display_name is an optional human-readable name for this credit note line item"
          },
          "invoice_line_item_id": {
            "type": "string",
            "description": "invoice_line_item_id is the unique identifier of the invoice line item being credited"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          }
        }
      },
      "CreateCreditNoteRequest": {
        "required": [
          "invoice_id",
          "reason"
        ],
        "type": "object",
        "properties": {
          "credit_note_number": {
            "type": "string",
            "description": "credit_note_number is an optional human-readable identifier for the credit note"
          },
          "idempotency_key": {
            "type": "string",
            "description": "idempotency_key is an optional key used to prevent duplicate credit note creation"
          },
          "invoice_id": {
            "type": "string",
            "description": "invoice_id is the unique identifier of the invoice this credit note is applied to"
          },
          "line_items": {
            "type": "array",
            "description": "line_items contains the individual line items that make up this credit note (minimum 1 required)",
            "items": {
              "$ref": "#/components/schemas/CreateCreditNoteLineItemRequest"
            }
          },
          "memo": {
            "type": "string",
            "description": "memo is an optional free-text field for additional notes about the credit note"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "process_credit_note": {
            "type": "boolean",
            "description": "process_credit_note is a flag to process the credit note after creation",
            "default": true
          },
          "reason": {
            "$ref": "#/components/schemas/types.CreditNoteReason"
          }
        }
      },
      "CreateCustomerRequest": {
        "required": [
          "external_id",
          "name"
        ],
        "type": "object",
        "properties": {
          "address_city": {
            "maxLength": 100,
            "type": "string",
            "description": "address_city is the city name with maximum 100 characters"
          },
          "address_country": {
            "type": "string",
            "description": "address_country is the two-letter ISO 3166-1 alpha-2 country code"
          },
          "address_line1": {
            "maxLength": 255,
            "type": "string",
            "description": "address_line1 is the primary address line with maximum 255 characters"
          },
          "address_line2": {
            "maxLength": 255,
            "type": "string",
            "description": "address_line2 is the secondary address line with maximum 255 characters"
          },
          "address_postal_code": {
            "maxLength": 20,
            "type": "string",
            "description": "address_postal_code is the ZIP code or postal code with maximum 20 characters"
          },
          "address_state": {
            "maxLength": 100,
            "type": "string",
            "description": "address_state is the state, province, or region name with maximum 100 characters"
          },
          "contact": {
            "maxLength": 20,
            "type": "string",
            "description": "contact is an optional contact number for the customer (e.g. phone)"
          },
          "email": {
            "type": "string",
            "description": "email is the customer's email address and must be a valid email format if provided"
          },
          "external_id": {
            "type": "string",
            "description": "external_id is the unique identifier from your system to reference this customer (required)"
          },
          "integration_entity_mapping": {
            "type": "array",
            "description": "integration_entity_mapping contains provider integration mappings for this customer",
            "items": {
              "$ref": "#/components/schemas/CreateEntityIntegrationMappingRequest"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "metadata contains additional key-value pairs for storing extra information"
          },
          "name": {
            "maxLength": 255,
            "type": "string",
            "description": "name is the full name or company name of the customer"
          },
          "onboarding_workflow_name": {
            "type": "string",
            "description": "onboarding_workflow_name is given if a custom onboarding workflow is to be triggered for this customer"
          },
          "skip_onboarding_workflow": {
            "type": "boolean",
            "description": "skip_onboarding_workflow when true, prevents the customer onboarding workflow from being triggered\nThis is used internally when a customer is created via a workflow to prevent infinite loops\nDefault: false"
          },
          "tax_rate_overrides": {
            "type": "array",
            "description": "tax_rate_overrides contains tax rate configurations to be linked to this customer",
            "items": {
              "$ref": "#/components/schemas/TaxRateOverride"
            }
          },
          "timezone": {
            "type": "string",
            "description": "timezone is the customer's IANA timezone name (e.g. \"Asia/Kolkata\", \"America/New_York\")\nDefaults to \"UTC\" if not provided"
          }
        },
        "description": "Request object for creating a new customer in the system"
      },
      "CreateEntitlementRequest": {
        "required": [
          "feature_id",
          "feature_type"
        ],
        "type": "object",
        "properties": {
          "aggregation_mode": {
            "$ref": "#/components/schemas/types.EntitlementAggregationMode"
          },
          "config_value": {
            "type": "object",
            "additionalProperties": true
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.EntitlementEntityType"
          },
          "feature_id": {
            "type": "string"
          },
          "feature_type": {
            "$ref": "#/components/schemas/types.FeatureType"
          },
          "grant_duration_unit": {
            "$ref": "#/components/schemas/types.EntitlementGrantDurationUnit"
          },
          "grant_duration_value": {
            "type": "integer"
          },
          "grant_measure": {
            "$ref": "#/components/schemas/types.EntitlementGrantMeasure"
          },
          "grant_quota": {
            "type": "string"
          },
          "is_enabled": {
            "type": "boolean"
          },
          "is_soft_limit": {
            "type": "boolean"
          },
          "parent_entitlement_id": {
            "type": "string"
          },
          "plan_id": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "static_value": {
            "type": "string"
          },
          "usage_limit": {
            "type": "integer"
          },
          "usage_reset_period": {
            "$ref": "#/components/schemas/types.EntitlementUsageResetPeriod"
          }
        }
      },
      "CreateEntityIntegrationMappingRequest": {
        "required": [
          "entity_id",
          "entity_type",
          "provider_entity_id",
          "provider_type"
        ],
        "type": "object",
        "properties": {
          "entity_id": {
            "maxLength": 255,
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.IntegrationEntityType"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "provider_entity_id": {
            "maxLength": 255,
            "type": "string"
          },
          "provider_type": {
            "maxLength": 50,
            "type": "string"
          }
        }
      },
      "CreateFeatureRequest": {
        "required": [
          "name",
          "type"
        ],
        "type": "object",
        "properties": {
          "alert_settings": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "description": {
            "type": "string"
          },
          "group_id": {
            "type": "string",
            "description": "GroupID is the id of the group to add the feature to"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "meter": {
            "$ref": "#/components/schemas/CreateMeterRequest"
          },
          "meter_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "reporting_unit": {
            "$ref": "#/components/schemas/types.ReportingUnit"
          },
          "type": {
            "$ref": "#/components/schemas/types.FeatureType"
          },
          "unit_plural": {
            "type": "string"
          },
          "unit_singular": {
            "type": "string"
          }
        }
      },
      "CreateGroupRequest": {
        "required": [
          "entity_type",
          "lookup_key",
          "name"
        ],
        "type": "object",
        "properties": {
          "entity_type": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "CreateInvoiceLineItemRequest": {
        "required": [
          "amount",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "adjusted_entitlement_quantity": {
            "type": "string",
            "description": "adjusted_entitlement_quantity is the entitlement-covered units deducted from raw usage."
          },
          "amount": {
            "type": "string",
            "description": "amount is the monetary amount for this line item"
          },
          "commitment_info": {
            "$ref": "#/components/schemas/types.CommitmentInfo"
          },
          "display_name": {
            "type": "string",
            "description": "display_name is the optional human-readable name for this line item"
          },
          "entity_id": {
            "type": "string",
            "description": "entity_id is the optional unique identifier of the entity associated with this line item"
          },
          "entity_type": {
            "type": "string",
            "description": "entity_type is the optional type of the entity associated with this line item"
          },
          "invoice_level_discount": {
            "type": "string",
            "description": "invoice_level_discount is the discount amount in invoice currency applied to all line items on the invoice."
          },
          "line_item_discount": {
            "type": "string",
            "description": "line_item_discount is the discount amount in invoice currency applied directly to this line item."
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "meter_display_name": {
            "type": "string",
            "description": "meter_display_name is the optional human-readable name of the meter"
          },
          "meter_id": {
            "type": "string",
            "description": "meter_id is the optional unique identifier of the meter used for usage tracking"
          },
          "period_end": {
            "type": "string",
            "description": "period_end is the optional end date of the period this line item covers",
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "description": "period_start is the optional start date of the period this line item covers",
            "format": "date-time"
          },
          "plan_display_name": {
            "type": "string",
            "description": "plan_display_name is the optional human-readable name of the plan"
          },
          "plan_id": {
            "type": "string",
            "description": "TODO: !REMOVE after migration\nplan_id is the optional unique identifier of the plan associated with this line item"
          },
          "prepaid_credits_applied": {
            "type": "string",
            "description": "prepaid_credits_applied is the amount in invoice currency reduced from this line item due to prepaid credits application."
          },
          "price_id": {
            "type": "string",
            "description": "price_id is the optional unique identifier of the price associated with this line item"
          },
          "price_type": {
            "type": "string",
            "description": "price_type indicates the type of pricing (fixed, usage, tiered, etc.)"
          },
          "price_unit": {
            "type": "string",
            "description": "price_unit is the optional 3-digit ISO code of the price unit associated with this line item"
          },
          "price_unit_amount": {
            "type": "string",
            "description": "price_unit_amount is the optional amount converted to the price unit currency"
          },
          "quantity": {
            "type": "string",
            "description": "quantity is the quantity of units for this line item"
          },
          "subscription_id": {
            "type": "string",
            "description": "subscription_id overrides the invoice's subscription_id for this specific line item.\nUsed for grouped invoicing where child line items belong to child subscriptions."
          },
          "subscription_line_item_id": {
            "type": "string",
            "description": "sub_line_item_id links this line item to the subscription_line_item that generated it."
          }
        }
      },
      "CreateInvoiceRequest": {
        "required": [
          "amount_due",
          "currency",
          "customer_id",
          "subtotal",
          "total"
        ],
        "type": "object",
        "properties": {
          "amount_due": {
            "type": "string",
            "description": "amount_due is the total amount that needs to be paid for this invoice"
          },
          "amount_paid": {
            "type": "string",
            "description": "amount_paid is the amount that has been paid towards this invoice"
          },
          "billing_period": {
            "type": "string",
            "description": "billing_period is the period this invoice covers (e.g., \"monthly\", \"yearly\")"
          },
          "billing_reason": {
            "$ref": "#/components/schemas/types.InvoiceBillingReason"
          },
          "coupons": {
            "type": "array",
            "description": "coupons",
            "items": {
              "type": "string"
            }
          },
          "currency": {
            "type": "string",
            "description": "currency is the three-letter ISO currency code (e.g., USD, EUR) for the invoice"
          },
          "customer_id": {
            "type": "string",
            "description": "customer_id is the unique identifier of the customer this invoice belongs to"
          },
          "description": {
            "type": "string",
            "description": "description is an optional text description of the invoice"
          },
          "due_date": {
            "type": "string",
            "description": "due_date is the date by which payment is expected",
            "format": "date-time"
          },
          "force_sync_invoice": {
            "type": "boolean",
            "description": "force_sync_invoice, when true, attempts to synchronously sync this invoice to\nMoyasar (if enabled) before returning, instead of relying solely on the async\nKafka + Temporal vendor-sync pipeline. Only honored by CreateOneOffInvoice.\nBest-effort: sync failures do not fail invoice creation."
          },
          "idempotency_key": {
            "type": "string",
            "description": "idempotency_key is an optional key used to prevent duplicate invoice creation"
          },
          "invoice_coupons": {
            "type": "array",
            "description": "Invoice Coupons",
            "items": {
              "$ref": "#/components/schemas/InvoiceCoupon"
            }
          },
          "invoice_number": {
            "type": "string",
            "description": "invoice_number is an optional human-readable identifier for the invoice"
          },
          "invoice_pdf_url": {
            "type": "string",
            "description": "invoice_pdf_url is the URL where customers can download the PDF version of this invoice"
          },
          "invoice_status": {
            "$ref": "#/components/schemas/types.InvoiceStatus"
          },
          "invoice_type": {
            "$ref": "#/components/schemas/types.InvoiceType"
          },
          "issue_date": {
            "type": "string",
            "description": "issue_date overrides the user-facing date of the invoice.\nDefaults to created_at if not provided.",
            "format": "date-time"
          },
          "line_item_coupons": {
            "type": "array",
            "description": "Invoice Line Item Coupons",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineItemCoupon"
            }
          },
          "line_items": {
            "type": "array",
            "description": "line_items contains the individual items that make up this invoice",
            "items": {
              "$ref": "#/components/schemas/CreateInvoiceLineItemRequest"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "payment_status": {
            "$ref": "#/components/schemas/types.PaymentStatus"
          },
          "period_end": {
            "type": "string",
            "description": "period_end is the end date of the billing period",
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "description": "period_start is the start date of the billing period",
            "format": "date-time"
          },
          "prepared_tax_rates": {
            "type": "array",
            "description": "prepared_tax_rates contains the tax rates pre-resolved by the caller (e.g., billing service)",
            "items": {
              "$ref": "#/components/schemas/TaxRateResponse"
            }
          },
          "subscription_id": {
            "type": "string",
            "description": "subscription_id is the optional unique identifier of the subscription associated with this invoice"
          },
          "subtotal": {
            "type": "string",
            "description": "subtotal is the amount before taxes and discounts are applied"
          },
          "tax_rate_overrides": {
            "type": "array",
            "description": "tax_rate_overrides is the tax rate overrides to be applied to the invoice",
            "items": {
              "$ref": "#/components/schemas/TaxRateOverride"
            }
          },
          "tax_rates": {
            "type": "array",
            "description": "tax_rates",
            "items": {
              "type": "string"
            }
          },
          "total": {
            "type": "string",
            "description": "total is the total amount of the invoice including taxes and discounts"
          },
          "total_prepaid_applied": {
            "type": "string",
            "description": "total_prepaid_applied is the total amount of prepaid applied to this invoice."
          }
        }
      },
      "CreateMeterRequest": {
        "required": [
          "aggregation",
          "event_name",
          "name",
          "reset_usage"
        ],
        "type": "object",
        "properties": {
          "aggregation": {
            "$ref": "#/components/schemas/meter.Aggregation"
          },
          "event_name": {
            "type": "string",
            "example": "api_request"
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/meter.Filter"
            }
          },
          "name": {
            "type": "string",
            "example": "API Usage Meter"
          },
          "reset_usage": {
            "$ref": "#/components/schemas/types.ResetUsage"
          }
        }
      },
      "CreatePaymentRequest": {
        "required": [
          "amount",
          "currency",
          "destination_id",
          "destination_type",
          "payment_method_type"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "cancel_url": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "destination_id": {
            "type": "string"
          },
          "destination_type": {
            "$ref": "#/components/schemas/types.PaymentDestinationType"
          },
          "gateway_options": {
            "$ref": "#/components/schemas/PaymentGatewayOptions"
          },
          "idempotency_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "payment_gateway": {
            "$ref": "#/components/schemas/types.PaymentGatewayType"
          },
          "payment_method_id": {
            "type": "string"
          },
          "payment_method_type": {
            "$ref": "#/components/schemas/types.PaymentMethodType"
          },
          "process_payment": {
            "type": "boolean",
            "default": true
          },
          "save_card_and_make_default": {
            "type": "boolean",
            "default": false
          },
          "success_url": {
            "type": "string"
          }
        }
      },
      "CreatePlanRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "display_order": {
            "type": "integer"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "CreatePriceRequest": {
        "required": [
          "billing_model",
          "billing_period",
          "currency",
          "entity_id",
          "entity_type",
          "invoice_cadence",
          "price_unit_type",
          "type"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "billing_model": {
            "$ref": "#/components/schemas/types.BillingModel"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.PriceEntityType"
          },
          "filter_values": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "group_id": {
            "type": "string",
            "description": "GroupID is the id of the group to add the price to"
          },
          "invoice_cadence": {
            "$ref": "#/components/schemas/types.InvoiceCadence"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "meter_id": {
            "type": "string"
          },
          "min_quantity": {
            "type": "integer",
            "description": "MinQuantity is the minimum quantity of the price"
          },
          "price_unit_config": {
            "$ref": "#/components/schemas/PriceUnitConfig"
          },
          "price_unit_type": {
            "$ref": "#/components/schemas/types.PriceUnitType"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "tier_mode": {
            "$ref": "#/components/schemas/types.BillingTier"
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreatePriceTier"
            }
          },
          "transform_quantity": {
            "$ref": "#/components/schemas/price.TransformQuantity"
          },
          "trial_period_days": {
            "type": "integer"
          },
          "type": {
            "$ref": "#/components/schemas/types.PriceType"
          }
        }
      },
      "CreatePriceTier": {
        "required": [
          "unit_amount"
        ],
        "type": "object",
        "properties": {
          "flat_amount": {
            "type": "string",
            "description": "flat_amount is the flat amount for the given tier (optional)\nApplied on top of unit_amount*quantity. Useful for cases like \"2.7$ + 5c\""
          },
          "unit_amount": {
            "type": "string",
            "description": "unit_amount is the amount per unit for the given tier"
          },
          "up_to": {
            "type": "integer",
            "description": "up_to is the quantity up to which this tier applies. It is null for the last tier.\nIMPORTANT: Tier boundaries are INCLUSIVE.\n- If up_to is 1000, then quantity less than or equal to 1000 belongs to this tier\n- This behavior is consistent across both VOLUME and SLAB tier modes"
          }
        }
      },
      "CreatePriceUnitRequest": {
        "required": [
          "base_currency",
          "code",
          "conversion_rate",
          "name",
          "symbol"
        ],
        "type": "object",
        "properties": {
          "base_currency": {
            "type": "string",
            "description": "base_currency  is the currency that the price unit is based on"
          },
          "code": {
            "type": "string"
          },
          "conversion_rate": {
            "type": "string",
            "description": "ConversionRate defines the exchange rate from this price unit to the base currency.\nThis rate is used to convert amounts in the custom price unit to the base currency for storage and billing.\n\nConversion formula:\n  price_unit_amount * conversion_rate = base_currency_amount\n\nExample:\n  If conversion_rate = \"0.01\" and base_currency = \"usd\":\n  100 price_unit tokens * 0.01 = 1.00 USD\n\nNote: Rounding precision is determined by the base currency (e.g., USD uses 2 decimal places, JPY uses 0)."
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          }
        }
      },
      "CreatePriceUnitResponse": {
        "type": "object",
        "properties": {
          "base_currency": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "conversion_rate": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "symbol": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "CreateScheduledTaskRequest": {
        "required": [
          "connection_id",
          "entity_type",
          "interval",
          "job_config"
        ],
        "type": "object",
        "properties": {
          "connection_id": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.ScheduledTaskEntityType"
          },
          "interval": {
            "$ref": "#/components/schemas/types.ScheduledTaskInterval"
          },
          "job_config": {
            "$ref": "#/components/schemas/types.S3JobConfig"
          }
        }
      },
      "CreateSubscriptionLineItemRequest": {
        "type": "object",
        "properties": {
          "commitment_amount": {
            "type": "number",
            "description": "Commitment fields"
          },
          "commitment_duration": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "commitment_overage_factor": {
            "type": "number"
          },
          "commitment_quantity": {
            "type": "number"
          },
          "commitment_time_buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommitmentBucketRequest"
            }
          },
          "commitment_true_up_enabled": {
            "type": "boolean"
          },
          "commitment_type": {
            "$ref": "#/components/schemas/types.CommitmentType"
          },
          "commitment_windowed": {
            "type": "boolean"
          },
          "display_name": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "price": {
            "$ref": "#/components/schemas/SubscriptionPriceCreateRequest"
          },
          "price_id": {
            "type": "string",
            "description": "PriceID references an existing price (plan, addon, or subscription-scoped). Exactly one of price_id or price must be set."
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          },
          "quantity": {
            "type": "number"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "subscription_phase_id": {
            "type": "string"
          }
        }
      },
      "CreateSubscriptionRequest": {
        "required": [
          "billing_period",
          "currency",
          "plan_id"
        ],
        "type": "object",
        "properties": {
          "addons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddAddonToSubscriptionRequest"
            }
          },
          "auto_invoice_threshold": {
            "type": "string",
            "description": "AutoInvoiceThreshold triggers a mid-period invoice when usage (in subscription currency) exceeds this amount.\nStandalone subscriptions only; all plan prices must be usage-based. Immutable after creation."
          },
          "billing_anchor": {
            "type": "string",
            "description": "BillingAnchor overrides the derived anchor for anniversary billing. For monthly billing,\nthe day-of-month defines cycle boundaries (shorter first period if start is before that day).",
            "format": "date-time"
          },
          "billing_cycle": {
            "$ref": "#/components/schemas/types.BillingCycle"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer"
          },
          "checkout": {
            "$ref": "#/components/schemas/CheckoutParams"
          },
          "collection_method": {
            "$ref": "#/components/schemas/types.CollectionMethod"
          },
          "commitment_amount": {
            "type": "string"
          },
          "commitment_duration": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "coupons": {
            "type": "array",
            "description": "Deprecated: use SubscriptionCoupons instead.",
            "items": {
              "type": "string"
            }
          },
          "credit_grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateCreditGrantRequest"
            }
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string",
            "description": "CustomerID takes priority over ExternalCustomerID when both are provided."
          },
          "enable_true_up": {
            "type": "boolean"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "external_customer_id": {
            "type": "string"
          },
          "gateway_payment_method_id": {
            "type": "string"
          },
          "inheritance": {
            "$ref": "#/components/schemas/SubscriptionInheritanceConfig"
          },
          "line_item_commitments": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/LineItemCommitmentConfig"
            },
            "description": "LineItemCommitments sets per-line-item commitment config, keyed by price_id."
          },
          "line_item_coupons": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Deprecated: use SubscriptionCoupons instead."
          },
          "line_items": {
            "type": "array",
            "description": "LineItems are extra (non-plan) line items added at creation.",
            "items": {
              "$ref": "#/components/schemas/CreateSubscriptionLineItemRequest"
            }
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "overage_factor": {
            "type": "string"
          },
          "override_entitlements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OverrideEntitlementRequest"
            }
          },
          "override_line_items": {
            "type": "array",
            "description": "OverrideLineItems overrides specific plan prices for this subscription.",
            "items": {
              "$ref": "#/components/schemas/OverrideLineItemRequest"
            }
          },
          "payment_behavior": {
            "$ref": "#/components/schemas/types.PaymentBehavior"
          },
          "payment_terms": {
            "$ref": "#/components/schemas/types.PaymentTerms"
          },
          "phases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionPhaseCreateRequest"
            }
          },
          "plan_id": {
            "type": "string"
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "subscription_coupons": {
            "type": "array",
            "description": "SubscriptionCoupons is the preferred way to attach coupons at creation.\nAccepts coupon_code; optionally targets a line item via price_id.",
            "items": {
              "$ref": "#/components/schemas/SubscriptionCouponInput"
            }
          },
          "subscription_status": {
            "$ref": "#/components/schemas/types.SubscriptionStatus"
          },
          "tax_rate_overrides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxRateOverride"
            }
          },
          "timezone": {
            "type": "string"
          },
          "trial_period_days": {
            "type": "integer",
            "description": "TrialPeriodDays: nil = inherit from plan prices, 0 = no trial, >0 = override in days."
          }
        }
      },
      "CreateTaxAssociationRequest": {
        "required": [
          "tax_rate_code"
        ],
        "type": "object",
        "properties": {
          "auto_apply": {
            "type": "boolean"
          },
          "currency": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "description": "EndDate sets when this association expires. Must be after StartDate when both are provided.",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.TaxRateEntityType"
          },
          "external_customer_id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "priority": {
            "type": "integer"
          },
          "start_date": {
            "type": "string",
            "description": "StartDate sets when this association becomes active. Defaults to now if omitted.",
            "format": "date-time"
          },
          "tax_rate_code": {
            "type": "string"
          }
        }
      },
      "CreateTaxRateRequest": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "code is the unique alphanumeric case sensitive identifier for the tax rate (required)"
          },
          "description": {
            "type": "string",
            "description": "description is an optional text description providing details about the tax rate"
          },
          "fixed_value": {
            "type": "string",
            "description": "fixed_value is the fixed monetary amount when tax_rate_type is \"fixed\""
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "metadata contains additional key-value pairs for storing extra information"
          },
          "name": {
            "type": "string",
            "description": "name is the human-readable name for the tax rate (required)"
          },
          "percentage_value": {
            "type": "string",
            "description": "percentage_value is the percentage value (0-100) when tax_rate_type is \"percentage\""
          },
          "scope": {
            "$ref": "#/components/schemas/types.TaxRateScope"
          },
          "tax_rate_type": {
            "$ref": "#/components/schemas/types.TaxRateType"
          }
        }
      },
      "CreateUserRequest": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Required when type is \"user\""
          },
          "name": {
            "type": "string",
            "description": "Display name; optional for service accounts"
          },
          "roles": {
            "type": "array",
            "description": "Required when type is \"service_account\"",
            "items": {
              "type": "string"
            }
          },
          "type": {
            "$ref": "#/components/schemas/types.UserType"
          }
        }
      },
      "CreateUserResponse": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Empty for service accounts"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tenant": {
            "$ref": "#/components/schemas/TenantResponse"
          },
          "type": {
            "$ref": "#/components/schemas/types.UserType"
          }
        }
      },
      "CreateWalletRequest": {
        "required": [
          "currency"
        ],
        "type": "object",
        "properties": {
          "alert_settings": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "auto_topup": {
            "$ref": "#/components/schemas/types.AutoTopup"
          },
          "conversion_rate": {
            "type": "string",
            "description": "amount in the currency =  number of credits * conversion_rate\nex if conversion_rate is 1, then 1 USD = 1 credit\nex if conversion_rate is 2, then 1 USD = 0.5 credits\nex if conversion_rate is 0.5, then 1 USD = 2 credits",
            "default": "1"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "external_customer_id": {
            "type": "string",
            "description": "external_customer_id is the customer id in the external system"
          },
          "initial_credits_expiry_date_utc": {
            "type": "string",
            "description": "initial_credits_expiry_date_utc is the expiry date in UTC timezone (optional to set nil means no expiry)\nex 2025-01-01 00:00:00 UTC"
          },
          "initial_credits_to_load": {
            "type": "string",
            "description": "initial_credits_to_load is the number of credits to load to the wallet\nif not provided, the wallet will be created with 0 balance\nNOTE: this is not the amount in the currency, but the number of credits",
            "default": "0"
          },
          "initial_credits_to_load_expiry_date": {
            "type": "integer",
            "description": "initial_credits_to_load_expiry_date YYYYMMDD format in UTC timezone (optional to set nil means no expiry)\nfor ex 20250101 means the credits will expire on 2025-01-01 00:00:00 UTC\nhence they will be available for use until 2024-12-31 23:59:59 UTC"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "price_unit": {
            "type": "string",
            "description": "price_unit is the code of the price unit to use for wallet creation\nIf provided, the price unit will be used to set the currency and conversion rate of the wallet:\n- currency: set to price unit's base_currency\n- conversion_rate: set to price unit's conversion_rate"
          },
          "topup_conversion_rate": {
            "type": "string",
            "description": "topup_conversion_rate is the conversion rate for the topup to the currency\nex if topup_conversion_rate is 1, then 1 USD = 1 credit\nex if topup_conversion_rate is 2, then 1 USD = 0.5 credits\nex if topup_conversion_rate is 0.5, then 1 USD = 2 credits"
          },
          "wallet_type": {
            "$ref": "#/components/schemas/types.WalletType"
          }
        }
      },
      "CreditGrantApplicationResponse": {
        "type": "object",
        "properties": {
          "application_reason": {
            "$ref": "#/components/schemas/types.CreditGrantApplicationReason"
          },
          "application_status": {
            "$ref": "#/components/schemas/types.ApplicationStatus"
          },
          "applied_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "credit_grant_id": {
            "type": "string"
          },
          "credits": {
            "type": "number"
          },
          "environment_id": {
            "type": "string"
          },
          "failure_reason": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "idempotency_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "period_end": {
            "type": "string",
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "format": "date-time"
          },
          "retry_count": {
            "type": "integer"
          },
          "scheduled_for": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string"
          },
          "subscription_status_at_application": {
            "$ref": "#/components/schemas/types.SubscriptionStatus"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "CreditGrantResponse": {
        "type": "object",
        "properties": {
          "addon_id": {
            "type": "string"
          },
          "cadence": {
            "$ref": "#/components/schemas/types.CreditGrantCadence"
          },
          "conversion_rate": {
            "type": "string",
            "description": "amount in the currency =  number of credits * conversion_rate\nex if conversion_rate is 1, then 1 USD = 1 credit\nex if conversion_rate is 2, then 1 USD = 0.5 credits\nex if conversion_rate is 0.5, then 1 USD = 2 credits"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "credit_grant_anchor": {
            "type": "string",
            "format": "date-time"
          },
          "credits": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "environment_id": {
            "type": "string"
          },
          "expiration_duration": {
            "type": "integer"
          },
          "expiration_duration_unit": {
            "$ref": "#/components/schemas/types.CreditGrantExpiryDurationUnit"
          },
          "expiration_type": {
            "$ref": "#/components/schemas/types.CreditGrantExpiryType"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          },
          "period": {
            "$ref": "#/components/schemas/types.CreditGrantPeriod"
          },
          "period_count": {
            "type": "integer"
          },
          "plan_id": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "scope": {
            "$ref": "#/components/schemas/types.CreditGrantScope"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "topup_conversion_rate": {
            "type": "string",
            "description": "topup_conversion_rate is the conversion rate for the topup to the currency\nex if topup_conversion_rate is 1, then 1 USD = 1 credit\nex if topup_conversion_rate is 2, then 1 USD = 0.5 credits\nex if topup_conversion_rate is 0.5, then 1 USD = 2 credits"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "CreditNoteResponse": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "credit_note_number": {
            "type": "string",
            "description": "credit_note_number is the unique identifier for credit notes"
          },
          "credit_note_status": {
            "$ref": "#/components/schemas/types.CreditNoteStatus"
          },
          "credit_note_type": {
            "$ref": "#/components/schemas/types.CreditNoteType"
          },
          "currency": {
            "type": "string",
            "description": "currency is the three-letter ISO currency code (e.g., USD, EUR) for the credit note"
          },
          "customer": {
            "$ref": "#/components/schemas/Customer"
          },
          "customer_id": {
            "type": "string",
            "description": "customer_id is the unique identifier of the customer who owns this credit note"
          },
          "environment_id": {
            "type": "string",
            "description": "environment_id is the unique identifier of the environment this credit note belongs to"
          },
          "finalized_at": {
            "type": "string",
            "description": "finalized_at is the timestamp when the credit note was finalized",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "description": "id is the unique identifier for the credit note"
          },
          "idempotency_key": {
            "type": "string",
            "description": "idempotency_key is an optional key used to prevent duplicate credit note creation"
          },
          "invoice": {
            "$ref": "#/components/schemas/InvoiceResponse"
          },
          "invoice_id": {
            "type": "string",
            "description": "invoice_id is the id of the invoice resource that this credit note is applied to"
          },
          "line_items": {
            "type": "array",
            "description": "line_items contains all of the line items associated with this credit note",
            "items": {
              "$ref": "#/components/schemas/creditnote.CreditNoteLineItem"
            }
          },
          "memo": {
            "type": "string",
            "description": "memo is an optional memo supplied on the credit note"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "reason": {
            "$ref": "#/components/schemas/types.CreditNoteReason"
          },
          "refund_status": {
            "$ref": "#/components/schemas/types.PaymentStatus"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription": {
            "$ref": "#/components/schemas/SubscriptionResponse"
          },
          "subscription_id": {
            "type": "string",
            "description": "subscription_id is the optional unique identifier of the subscription related to this credit note"
          },
          "tenant_id": {
            "type": "string"
          },
          "total_amount": {
            "type": "string",
            "description": "total_amount is the total including creditable invoice-level discounts or minimums, and tax"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "voided_at": {
            "type": "string",
            "description": "voided_at is the timestamp when the credit note was voided",
            "format": "date-time"
          }
        }
      },
      "CustomAnalyticItem": {
        "type": "object",
        "properties": {
          "feature_name": {
            "type": "string",
            "description": "Name of the feature this applies to"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Calculation name (e.g., \"Revenue per Minute\")"
          },
          "type": {
            "type": "string",
            "description": "\"feature\", \"meter\", \"event_name\""
          },
          "value": {
            "type": "string"
          }
        }
      },
      "CustomerEntitlementsResponse": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AggregatedFeature"
            }
          },
          "subscriptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionResponse"
            }
          }
        }
      },
      "CustomerInvoiceSummary": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "description": "currency is the three-letter ISO currency code for this summary"
          },
          "customer_id": {
            "type": "string",
            "description": "customer_id is the unique identifier of the customer"
          },
          "overdue_invoice_count": {
            "type": "integer",
            "description": "overdue_invoice_count is the number of overdue invoices for this customer in this currency"
          },
          "total_invoice_count": {
            "type": "integer",
            "description": "total_invoice_count is the total number of invoices for this customer in this currency"
          },
          "total_overdue_amount": {
            "type": "string",
            "description": "total_overdue_amount is the total amount of overdue invoices in this currency"
          },
          "total_revenue_amount": {
            "type": "string",
            "description": "total_revenue_amount is the total revenue generated from this customer in this currency"
          },
          "total_unpaid_amount": {
            "type": "string",
            "description": "total_unpaid_amount is the total amount of unpaid invoices in this currency"
          },
          "unpaid_fixed_charges": {
            "type": "string",
            "description": "unpaid_fixed_charges is the total amount of unpaid fixed charges in this currency"
          },
          "unpaid_invoice_count": {
            "type": "integer",
            "description": "unpaid_invoice_count is the number of unpaid invoices for this customer in this currency"
          },
          "unpaid_usage_charges": {
            "type": "string",
            "description": "unpaid_usage_charges is the total amount of unpaid usage-based charges in this currency"
          }
        }
      },
      "CustomerLookupResult": {
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/Customer"
          },
          "error": {
            "$ref": "#/components/schemas/errors.ErrorResponse"
          },
          "status": {
            "$ref": "#/components/schemas/types.DebugTrackerStatus"
          }
        }
      },
      "CustomerMultiCurrencyInvoiceSummary": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string",
            "description": "customer_id is the unique identifier of the customer"
          },
          "default_currency": {
            "type": "string",
            "description": "default_currency is the primary currency for this customer"
          },
          "summaries": {
            "type": "array",
            "description": "summaries contains the invoice summaries for each currency",
            "items": {
              "$ref": "#/components/schemas/CustomerInvoiceSummary"
            }
          }
        }
      },
      "CustomerResponse": {
        "type": "object",
        "properties": {
          "address_city": {
            "type": "string",
            "description": "AddressCity is the city of the customer's address"
          },
          "address_country": {
            "type": "string",
            "description": "AddressCountry is the country of the customer's address (ISO 3166-1 alpha-2)"
          },
          "address_line1": {
            "type": "string",
            "description": "AddressLine1 is the first line of the customer's address"
          },
          "address_line2": {
            "type": "string",
            "description": "AddressLine2 is the second line of the customer's address"
          },
          "address_postal_code": {
            "type": "string",
            "description": "AddressPostalCode is the postal code of the customer's address"
          },
          "address_state": {
            "type": "string",
            "description": "AddressState is the state of the customer's address"
          },
          "contact": {
            "type": "string",
            "description": "Contact is an optional contact number for the customer (e.g. phone)"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "description": "Email is the email of the customer"
          },
          "environment_id": {
            "type": "string",
            "description": "EnvironmentID is the environment identifier for the customer"
          },
          "external_id": {
            "type": "string",
            "description": "ExternalID is the external identifier for the customer"
          },
          "id": {
            "type": "string",
            "description": "ID is the unique identifier for the customer"
          },
          "integrations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntityIntegrationMappingResponse"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Metadata"
          },
          "name": {
            "type": "string",
            "description": "Name is the name of the customer"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "timezone": {
            "type": "string",
            "description": "Timezone is the customer's IANA timezone name (e.g. \"Asia/Kolkata\").\nDefaults to \"UTC\". Inherited by subscriptions at creation time."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        },
        "description": "Customer response object containing all customer information"
      },
      "CustomerUsageSummaryResponse": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeatureUsageSummary"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          },
          "period": {
            "$ref": "#/components/schemas/BillingPeriodInfo"
          }
        }
      },
      "DebugTracker": {
        "type": "object",
        "properties": {
          "attributed_to_customer": {
            "$ref": "#/components/schemas/AttributedToCustomerResult"
          },
          "customer_lookup": {
            "$ref": "#/components/schemas/CustomerLookupResult"
          },
          "failure_point": {
            "$ref": "#/components/schemas/types.FailurePoint"
          },
          "meter_matching": {
            "$ref": "#/components/schemas/MeterMatchingResult"
          },
          "price_lookup": {
            "$ref": "#/components/schemas/PriceLookupResult"
          },
          "subscription_line_item_lookup": {
            "$ref": "#/components/schemas/SubscriptionLineItemLookupResult"
          }
        }
      },
      "DeleteCostsheetResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "DeleteCreditGrantRequest": {
        "type": "object",
        "properties": {
          "effective_date": {
            "type": "string",
            "description": "EffectiveDate is optional; when set (subscription scope) the grant end date is set to this time.",
            "format": "date-time"
          }
        }
      },
      "DeletePriceRequest": {
        "type": "object",
        "properties": {
          "end_date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DeleteSubscriptionLineItemRequest": {
        "type": "object",
        "properties": {
          "effective_from": {
            "type": "string"
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          }
        }
      },
      "DelinkIntegrationMappingRequest": {
        "required": [
          "entity_id",
          "entity_type",
          "provider_type"
        ],
        "type": "object",
        "properties": {
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.IntegrationEntityType"
          },
          "provider_type": {
            "type": "string"
          }
        }
      },
      "EntitlementResponse": {
        "type": "object",
        "properties": {
          "addon": {
            "$ref": "#/components/schemas/AddonResponse"
          },
          "aggregation_mode": {
            "$ref": "#/components/schemas/types.EntitlementAggregationMode"
          },
          "config_value": {
            "type": "object",
            "additionalProperties": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "display_order": {
            "type": "integer"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.EntitlementEntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "feature": {
            "$ref": "#/components/schemas/FeatureResponse"
          },
          "feature_id": {
            "type": "string"
          },
          "feature_type": {
            "$ref": "#/components/schemas/types.FeatureType"
          },
          "grant_duration_unit": {
            "$ref": "#/components/schemas/types.EntitlementGrantDurationUnit"
          },
          "grant_duration_value": {
            "type": "integer"
          },
          "grant_measure": {
            "$ref": "#/components/schemas/types.EntitlementGrantMeasure"
          },
          "grant_quota": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "is_enabled": {
            "type": "boolean"
          },
          "is_soft_limit": {
            "type": "boolean"
          },
          "parent_entitlement_id": {
            "type": "string"
          },
          "plan": {
            "$ref": "#/components/schemas/PlanResponse"
          },
          "plan_id": {
            "type": "string",
            "description": "TODO: Remove this once we have a proper entitlement entity type"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "static_value": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "usage_limit": {
            "type": "integer"
          },
          "usage_reset_period": {
            "$ref": "#/components/schemas/types.EntitlementUsageResetPeriod"
          }
        }
      },
      "EntitlementSource": {
        "type": "object",
        "properties": {
          "config_value": {
            "type": "object",
            "additionalProperties": true
          },
          "entitlement_id": {
            "type": "string"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_name": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/EntitlementSourceEntityType"
          },
          "is_enabled": {
            "type": "boolean"
          },
          "quantity": {
            "type": "integer"
          },
          "static_value": {
            "type": "string"
          },
          "subscription_id": {
            "type": "string"
          },
          "usage_limit": {
            "type": "integer"
          },
          "usage_reset_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          }
        }
      },
      "EntitlementSourceEntityType": {
        "type": "string",
        "enum": [
          "plan",
          "addon",
          "subscription"
        ],
        "x-enum-varnames": [
          "EntitlementSourceEntityTypePlan",
          "EntitlementSourceEntityTypeAddon",
          "EntitlementSourceEntityTypeSubscription"
        ]
      },
      "EntityChangePolicy": {
        "type": "object",
        "properties": {
          "default_behaviour": {
            "$ref": "#/components/schemas/types.EntityChangeBehaviour"
          },
          "overrides": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/types.EntityChangeBehaviour"
            },
            "description": "Overrides is keyed by addon_associations.id (instance), not catalogue addon_id."
          }
        }
      },
      "EntityChangeResult": {
        "type": "object",
        "properties": {
          "behaviour": {
            "$ref": "#/components/schemas/types.EntityChangeBehaviour"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.SubscriptionLineItemEntityType"
          },
          "reference_id": {
            "type": "string"
          }
        }
      },
      "EntityIntegrationMappingResponse": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.IntegrationEntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "provider_entity_id": {
            "type": "string"
          },
          "provider_type": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "Event": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "event_name": {
            "type": "string"
          },
          "external_customer_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "properties": {
            "type": "object",
            "additionalProperties": true
          },
          "source": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          }
        }
      },
      "EventCostInfo": {
        "type": "object",
        "properties": {
          "costNanoUsd": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        }
      },
      "ExecuteSubscriptionModifyRequest": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "checkout": {
            "$ref": "#/components/schemas/CheckoutParams"
          },
          "coupon_params": {
            "$ref": "#/components/schemas/SubModifyCouponParams"
          },
          "grouped_invoicing_params": {
            "$ref": "#/components/schemas/SubModifyGroupedInvoicingParams"
          },
          "inheritance_params": {
            "$ref": "#/components/schemas/SubModifyInheritanceRequest"
          },
          "quantity_change_params": {
            "$ref": "#/components/schemas/SubModifyQuantityChangeRequest"
          },
          "tax_params": {
            "$ref": "#/components/schemas/SubModifyTaxParams"
          },
          "trial_end_params": {
            "$ref": "#/components/schemas/SubModifyTrialEndRequest"
          },
          "type": {
            "$ref": "#/components/schemas/SubscriptionModifyType"
          }
        }
      },
      "FeatureResponse": {
        "type": "object",
        "properties": {
          "alert_settings": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "group": {
            "$ref": "#/components/schemas/GroupResponse"
          },
          "group_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "meter": {
            "$ref": "#/components/schemas/MeterResponse"
          },
          "meter_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "reporting_unit": {
            "$ref": "#/components/schemas/types.ReportingUnit"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/types.FeatureType"
          },
          "unit_plural": {
            "type": "string"
          },
          "unit_singular": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "FeatureUsageInfo": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "feature_id": {
            "type": "string"
          },
          "meter_id": {
            "type": "string"
          },
          "price_id": {
            "type": "string"
          },
          "processed_at": {
            "type": "string",
            "format": "date-time"
          },
          "qty_total": {
            "type": "string"
          },
          "sub_line_item_id": {
            "type": "string"
          },
          "subscription_id": {
            "type": "string"
          }
        }
      },
      "FeatureUsageSummary": {
        "type": "object",
        "properties": {
          "current_usage": {
            "type": "string"
          },
          "feature": {
            "$ref": "#/components/schemas/FeatureResponse"
          },
          "is_enabled": {
            "type": "boolean"
          },
          "is_soft_limit": {
            "type": "boolean"
          },
          "is_unlimited": {
            "type": "boolean"
          },
          "next_usage_reset_at": {
            "type": "string",
            "format": "date-time"
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntitlementSource"
            }
          },
          "total_limit": {
            "type": "integer"
          },
          "usage_percent": {
            "type": "string"
          }
        }
      },
      "GCPMarketplaceAgreement": {
        "required": [
          "account_id",
          "metric_name",
          "service_name",
          "usage_reporting_id"
        ],
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "writes the customer mapping; not read in the report payload"
          },
          "metric_name": {
            "type": "string",
            "description": "-> services.report's metricName (always \"{service_name}/usage_fee\")"
          },
          "service_name": {
            "type": "string",
            "description": "-> services.report URL's service_name; identifies the product"
          },
          "usage_reporting_id": {
            "type": "string",
            "description": "-> services.report's consumerId; identifies the buyer"
          }
        }
      },
      "GetCostAnalyticsRequest": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "expand": {
            "type": "array",
            "description": "Expand options - specify which entities to expand",
            "items": {
              "type": "string"
            }
          },
          "external_customer_id": {
            "type": "string",
            "description": "Optional - for specific customer"
          },
          "feature_ids": {
            "type": "array",
            "description": "Additional filters",
            "items": {
              "type": "string"
            }
          },
          "include_children": {
            "type": "boolean",
            "description": "IncludeChildren, when true and ExternalCustomerID belongs to a parent\ncustomer, aggregates every inherited-child customer's usage into the\nrevenue and cost totals. Default (false) restricts the query to the\ncustomer's own usage \u2014 mirrors the meter-usage analytics contract."
          },
          "limit": {
            "type": "integer",
            "description": "Pagination"
          },
          "offset": {
            "type": "integer"
          },
          "property_filters": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Property filters to filter the events by the keys in `properties` field of the event"
          },
          "start_time": {
            "type": "string",
            "description": "Time range fields (optional - defaults to last 7 days if not provided)",
            "format": "date-time"
          }
        }
      },
      "GetCostsheetResponse": {
        "type": "object",
        "properties": {
          "costsheet": {
            "$ref": "#/components/schemas/CostsheetResponse"
          }
        }
      },
      "GetDetailedCostAnalyticsResponse": {
        "type": "object",
        "properties": {
          "cost_analytics": {
            "type": "array",
            "description": "Cost analytics array (flattened from nested structure)",
            "items": {
              "$ref": "#/components/schemas/CostAnalyticItem"
            }
          },
          "currency": {
            "type": "string"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "margin": {
            "type": "string",
            "description": "Revenue - Cost"
          },
          "margin_percent": {
            "type": "string",
            "description": "(Margin / Revenue) * 100"
          },
          "roi": {
            "type": "string",
            "description": "(Revenue - Cost) / Cost"
          },
          "roi_percent": {
            "type": "string",
            "description": "ROI * 100"
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "total_cost": {
            "type": "string"
          },
          "total_revenue": {
            "type": "string",
            "description": "Derived metrics"
          }
        }
      },
      "GetEventByIDResponse": {
        "type": "object",
        "properties": {
          "debug_tracker": {
            "$ref": "#/components/schemas/DebugTracker"
          },
          "event": {
            "$ref": "#/components/schemas/Event"
          },
          "processed_events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeatureUsageInfo"
            }
          },
          "status": {
            "$ref": "#/components/schemas/types.EventProcessingStatusType"
          }
        }
      },
      "GetEventsRequest": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "description": "End time of the events to be fetched in ISO 8601 format\nDefaults to now if not provided",
            "example": "2024-12-09T00:00:00Z",
            "format": "date-time"
          },
          "event_id": {
            "type": "string",
            "description": "Event ID is the idempotency key for the event"
          },
          "event_name": {
            "type": "string",
            "description": "Event name / Unique identifier for the event in your system"
          },
          "external_customer_id": {
            "type": "string",
            "description": "Customer ID in your system that was sent with the event"
          },
          "iter_first_key": {
            "type": "string",
            "description": "First key to iterate over the events"
          },
          "iter_last_key": {
            "type": "string",
            "description": "Last key to iterate over the events"
          },
          "offset": {
            "type": "integer",
            "description": "Offset to fetch the events and is set to 0 by default"
          },
          "order": {
            "type": "string",
            "description": "Order by condition. Allowed values (case sensitive): asc, desc (default: desc)",
            "example": "desc"
          },
          "page_size": {
            "type": "integer",
            "description": "Page size to fetch the events and is set to 50 by default"
          },
          "property_filters": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Property filters to filter the events by the keys in `properties` field of the event"
          },
          "sort": {
            "type": "string",
            "description": "Sort by the field. Allowed values (case sensitive): timestamp, event_name (default: timestamp)",
            "example": "timestamp"
          },
          "source": {
            "type": "string",
            "description": "Source to filter the events by the source"
          },
          "start_time": {
            "type": "string",
            "description": "Start time of the events to be fetched in ISO 8601 format\nDefaults to last 7 days from now if not provided",
            "example": "2024-11-09T00:00:00Z",
            "format": "date-time"
          }
        }
      },
      "GetEventsResponse": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "iter_first_key": {
            "type": "string"
          },
          "iter_last_key": {
            "type": "string"
          },
          "offset": {
            "type": "integer"
          },
          "total_count": {
            "type": "integer"
          }
        }
      },
      "GetHuggingFaceBillingDataRequest": {
        "required": [
          "requestIds"
        ],
        "type": "object",
        "properties": {
          "requestIds": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "GetHuggingFaceBillingDataResponse": {
        "type": "object",
        "properties": {
          "requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventCostInfo"
            }
          }
        }
      },
      "GetPendingSchedulesResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "description": "count is the number of pending schedules"
          },
          "schedules": {
            "type": "array",
            "description": "schedules is the list of pending schedules",
            "items": {
              "$ref": "#/components/schemas/SubscriptionScheduleResponse"
            }
          }
        },
        "description": "List of pending schedules for a subscription"
      },
      "GetPreviewInvoiceRequest": {
        "required": [
          "subscription_id"
        ],
        "type": "object",
        "properties": {
          "hide_zero_charges_line_items": {
            "type": "boolean",
            "description": "hide_zero_charges_line_items indicates whether to hide line items with zero cost",
            "default": false
          },
          "period_end": {
            "type": "string",
            "description": "period_end is the optional end date of the period to preview",
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "description": "period_start is the optional start date of the period to preview",
            "format": "date-time"
          },
          "subscription_id": {
            "type": "string",
            "description": "subscription_id is the unique identifier of the subscription to preview invoice for"
          }
        }
      },
      "GetUsageAnalyticsRequest": {
        "type": "object",
        "properties": {
          "breakdown_bucket": {
            "type": "boolean",
            "description": "BreakdownBucket when true augments each time-series point with BucketID/PriceID\nand appends a BucketSummaries rollup to each item. Requires WindowSize to be set\nand the item to be linked to a subscription line item that has CommitmentTimeBuckets.\nDefault: false (opt-in, backward compatible)."
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "expand": {
            "type": "array",
            "description": "allowed values: \"price\", \"meter\", \"feature\", \"subscription_line_item\",\"plan\",\"addon\"",
            "items": {
              "type": "string"
            }
          },
          "external_customer_id": {
            "type": "string",
            "description": "ExternalCustomerID is the single external customer ID.\nOptional when ExternalCustomerIDs is provided; required otherwise."
          },
          "feature_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "group_by": {
            "type": "array",
            "description": "allowed values: \"source\", \"feature_id\", \"properties.<field_name>\"",
            "items": {
              "type": "string"
            }
          },
          "include_children": {
            "type": "boolean",
            "description": "IncludeChildren when true folds child customers' usage into the single aggregated total.\nDefault: false."
          },
          "property_filters": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Property filters to filter the events by the keys in `properties` field of the event"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "window_size": {
            "$ref": "#/components/schemas/types.WindowSize"
          }
        }
      },
      "GetUsageAnalyticsResponse": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string"
          },
          "custom_analytics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomAnalyticItem"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageAnalyticItem"
            }
          },
          "subtotal": {
            "type": "string"
          },
          "total_cost": {
            "type": "string",
            "description": "TotalCost is the final cost after discount (Subtotal - TotalDiscount)"
          },
          "total_discount": {
            "type": "string"
          }
        }
      },
      "GetUsageByMeterRequest": {
        "required": [
          "meter_id"
        ],
        "type": "object",
        "properties": {
          "billing_anchor": {
            "type": "string",
            "description": "BillingAnchor enables custom monthly billing periods for meter usage aggregation.\n\nUsage guidelines:\n- Only effective when WindowSize = \"MONTH\"\n- For other window sizes (DAY, HOUR, WEEK), this field is ignored\n- When nil, uses standard calendar months (1st to 1st)\n- When provided, creates custom monthly periods (e.g., 5th to 5th)\n\nCommon use cases:\n- Subscription billing periods that don't align with calendar months\n- Customer-specific billing cycles (e.g., signed up on 15th)\n- Multi-tenant systems with different billing anchor dates\n\nExample: If BillingAnchor = \"2024-03-05T14:30:45Z\" and WindowSize = \"MONTH\":\n  - March period: 2024-03-05 14:30:45 to 2024-04-05 14:30:45\n  - April period: 2024-04-05 14:30:45 to 2024-05-05 14:30:45",
            "example": "2024-03-05T14:30:45Z",
            "format": "date-time"
          },
          "bucket_size": {
            "$ref": "#/components/schemas/types.WindowSize"
          },
          "customer_id": {
            "type": "string",
            "example": "customer456"
          },
          "end_time": {
            "type": "string",
            "example": "2024-12-09T00:00:00Z",
            "format": "date-time"
          },
          "external_customer_id": {
            "type": "string",
            "example": "user_5"
          },
          "filters": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "meter_id": {
            "type": "string",
            "example": "123"
          },
          "start_time": {
            "type": "string",
            "example": "2024-11-09T00:00:00Z",
            "format": "date-time"
          },
          "timezone": {
            "type": "string"
          },
          "window_size": {
            "$ref": "#/components/schemas/types.WindowSize"
          }
        }
      },
      "GetUsageBySubscriptionRequest": {
        "required": [
          "subscription_id"
        ],
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "example": "2024-03-20T00:00:00Z",
            "format": "date-time"
          },
          "lifetime_usage": {
            "type": "boolean",
            "example": false
          },
          "start_time": {
            "type": "string",
            "example": "2024-03-13T00:00:00Z",
            "format": "date-time"
          },
          "subscription_id": {
            "type": "string",
            "example": "123"
          }
        }
      },
      "GetUsageBySubscriptionResponse": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number"
          },
          "charges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionUsageByMetersResponse"
            }
          },
          "commitment_amount": {
            "type": "number"
          },
          "commitment_utilized": {
            "type": "number",
            "description": "Amount of commitment used"
          },
          "currency": {
            "type": "string"
          },
          "display_amount": {
            "type": "string"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "has_overage": {
            "type": "boolean",
            "description": "Whether any usage exceeded commitment"
          },
          "overage_amount": {
            "type": "number",
            "description": "Amount charged at overage rate"
          },
          "overage_factor": {
            "type": "number"
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GetUsageRequest": {
        "required": [
          "aggregation_type",
          "event_name"
        ],
        "type": "object",
        "properties": {
          "aggregation_type": {
            "$ref": "#/components/schemas/types.AggregationType"
          },
          "billing_anchor": {
            "type": "string",
            "description": "BillingAnchor enables custom monthly billing periods for usage aggregation.\n\nWhen to use:\n- WindowSize = \"MONTH\" AND you need custom monthly periods (not calendar months)\n- Subscription billing that doesn't align with calendar months\n- Example: Customer signed up on 15th, so billing periods are 15th to 15th\n\nWhen NOT to use:\n- WindowSize != \"MONTH\" (ignored for DAY, HOUR, WEEK, etc.)\n- Standard calendar-based billing (1st to 1st of each month)\n\nExample values:\n- \"2024-03-05T14:30:45.123456789Z\" (5th of each month at 2:30:45 PM)\n- \"2024-01-15T00:00:00Z\" (15th of each month at midnight)\n- \"2024-02-29T12:00:00Z\" (29th of each month at noon - handles leap years)",
            "example": "2024-03-05T14:30:45.123456789Z",
            "format": "date-time"
          },
          "bucket_size": {
            "$ref": "#/components/schemas/types.WindowSize"
          },
          "customer_id": {
            "type": "string",
            "example": "customer456"
          },
          "end_time": {
            "type": "string",
            "example": "2024-03-20T00:00:00Z",
            "format": "date-time"
          },
          "event_name": {
            "type": "string",
            "example": "api_request"
          },
          "external_customer_id": {
            "type": "string",
            "example": "customer456"
          },
          "filters": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "group_by": {
            "type": "array",
            "description": "GroupBy lists the analytics group_by dimensions.\n  - \"source\"        \u2014 group by event source column\n  - \"properties.X\"  \u2014 group by JSON property X",
            "items": {
              "type": "string"
            }
          },
          "group_by_property": {
            "type": "string",
            "description": "GroupByProperty is the property name in event.properties to group by before aggregating.\nWhen set, aggregation is applied per unique value of this property within each bucket,\nthen the per-group results are summed to produce the bucket total.\n\nDeprecated: prefer GroupBy []string{\"properties.<X>\"} for parity with\nother analytics endpoints. ToUsageParams translates this field into\nGroupBy when GroupBy is otherwise empty."
          },
          "multiplier": {
            "type": "string"
          },
          "property_name": {
            "type": "string",
            "description": "will be empty/ignored in case of COUNT",
            "example": "request_size"
          },
          "start_time": {
            "type": "string",
            "example": "2024-03-13T00:00:00Z",
            "format": "date-time"
          },
          "timezone": {
            "type": "string"
          },
          "window_size": {
            "$ref": "#/components/schemas/types.WindowSize"
          }
        }
      },
      "GetUsageResponse": {
        "type": "object",
        "properties": {
          "event_name": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageResult"
            }
          },
          "type": {
            "$ref": "#/components/schemas/types.AggregationType"
          },
          "value": {
            "type": "number"
          }
        }
      },
      "GroupResponse": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "entity_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "entity_type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GroupedInvoicingAction": {
        "type": "string",
        "enum": [
          "add",
          "remove"
        ],
        "x-enum-varnames": [
          "GroupedInvoicingActionAdd",
          "GroupedInvoicingActionRemove"
        ]
      },
      "GroupedInvoicingChildRequest": {
        "required": [
          "external_customer_id",
          "plan_id"
        ],
        "type": "object",
        "properties": {
          "addons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddAddonToSubscriptionRequest"
            }
          },
          "commitment_amount": {
            "type": "string"
          },
          "commitment_duration": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "coupons": {
            "type": "array",
            "description": "Deprecated: use SubscriptionCoupons instead.",
            "items": {
              "type": "string"
            }
          },
          "credit_grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateCreditGrantRequest"
            }
          },
          "enable_true_up": {
            "type": "boolean"
          },
          "external_customer_id": {
            "type": "string"
          },
          "line_item_commitments": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/LineItemCommitmentConfig"
            },
            "description": "LineItemCommitments sets per-line-item commitment config, keyed by price_id."
          },
          "line_item_coupons": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Deprecated: use SubscriptionCoupons instead."
          },
          "line_items": {
            "type": "array",
            "description": "LineItems are extra (non-plan) line items added at creation.",
            "items": {
              "$ref": "#/components/schemas/CreateSubscriptionLineItemRequest"
            }
          },
          "overage_factor": {
            "type": "string"
          },
          "override_entitlements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OverrideEntitlementRequest"
            }
          },
          "override_line_items": {
            "type": "array",
            "description": "OverrideLineItems overrides specific plan prices for this subscription.",
            "items": {
              "$ref": "#/components/schemas/OverrideLineItemRequest"
            }
          },
          "phases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionPhaseCreateRequest"
            }
          },
          "plan_id": {
            "type": "string"
          },
          "subscription_coupons": {
            "type": "array",
            "description": "SubscriptionCoupons is the preferred way to attach coupons at creation.\nAccepts coupon_code; optionally targets a line item via price_id.",
            "items": {
              "$ref": "#/components/schemas/SubscriptionCouponInput"
            }
          },
          "tax_rate_overrides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxRateOverride"
            }
          },
          "trial_period_days": {
            "type": "integer",
            "description": "TrialPeriodDays: nil = inherit from plan prices, 0 = no trial, >0 = override in days."
          }
        }
      },
      "IngestEventRequest": {
        "required": [
          "event_name",
          "external_customer_id"
        ],
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string",
            "example": "customer456"
          },
          "event_id": {
            "type": "string",
            "example": "event123"
          },
          "event_name": {
            "type": "string",
            "example": "api_request"
          },
          "external_customer_id": {
            "type": "string",
            "example": "customer456"
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Handled separately for dynamic columns",
            "example": {
              "\"response_status\"": "200}",
              "{\"request_size\"": "100"
            }
          },
          "source": {
            "type": "string",
            "example": "api"
          },
          "timestamp": {
            "type": "string",
            "description": "Handled separately due to parsing",
            "example": "2024-03-20T15:04:05Z"
          }
        }
      },
      "InheritanceAction": {
        "type": "string",
        "enum": [
          "add",
          "remove"
        ],
        "x-enum-varnames": [
          "InheritanceActionAdd",
          "InheritanceActionRemove"
        ]
      },
      "IntegrationConfigEntry": {
        "type": "object",
        "properties": {
          "base_config": {
            "$ref": "#/components/schemas/types.SyncConfig"
          },
          "current_config": {
            "$ref": "#/components/schemas/types.SyncConfig"
          },
          "provider": {
            "$ref": "#/components/schemas/types.SecretProvider"
          }
        }
      },
      "IntegrationConfigResponse": {
        "type": "object",
        "properties": {
          "integrations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationConfigEntry"
            }
          }
        }
      },
      "InvoiceCoupon": {
        "required": [
          "coupon_id"
        ],
        "type": "object",
        "properties": {
          "coupon_association_id": {
            "type": "string"
          },
          "coupon_id": {
            "type": "string"
          }
        }
      },
      "InvoiceLineItemCoupon": {
        "required": [
          "coupon_id",
          "line_item_id"
        ],
        "type": "object",
        "properties": {
          "coupon_association_id": {
            "type": "string"
          },
          "coupon_id": {
            "type": "string"
          },
          "line_item_id": {
            "type": "string",
            "description": "price_id used to match the line item"
          }
        }
      },
      "InvoiceLineItemPreview": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "amount for this line item"
          },
          "description": {
            "type": "string",
            "description": "description of the line item"
          },
          "is_proration": {
            "type": "boolean",
            "description": "is_proration indicates if this line item is a proration"
          },
          "period_end": {
            "type": "string",
            "description": "period_end for this line item (if applicable)",
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "description": "period_start for this line item (if applicable)",
            "format": "date-time"
          },
          "quantity": {
            "type": "string",
            "description": "quantity for this line item"
          },
          "unit_price": {
            "type": "string",
            "description": "unit_price for this line item"
          }
        }
      },
      "InvoiceLineItemResponse": {
        "type": "object",
        "properties": {
          "adjusted_entitlement_quantity": {
            "type": "string",
            "description": "adjusted_entitlement_quantity is the entitlement-covered portion deducted from raw usage.\nNil when no entitlement was applied. Raw usage = Quantity + AdjustedEntitlementQuantity."
          },
          "amount": {
            "type": "string"
          },
          "commitment_info": {
            "$ref": "#/components/schemas/types.CommitmentInfo"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invoice_id": {
            "type": "string"
          },
          "invoice_level_discount": {
            "type": "string",
            "description": "invoice_level_discount is the discount amount in invoice currency applied to all line items on the invoice."
          },
          "line_item_discount": {
            "type": "string",
            "description": "line_item_discount is the discount amount in invoice currency applied directly to this line item."
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "meter_display_name": {
            "type": "string"
          },
          "meter_id": {
            "type": "string"
          },
          "parent_line_item_id": {
            "type": "string",
            "description": "parent_line_item_id links this line item to the line item it replaced, if it was created by editing\nan existing line item. Forms a linked-list chain across edits; nil for line items that were never edited."
          },
          "period_end": {
            "type": "string",
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "format": "date-time"
          },
          "plan_display_name": {
            "type": "string"
          },
          "prepaid_credits_applied": {
            "type": "string",
            "description": "prepaid_credits_applied is the amount in invoice currency reduced from this line item due to prepaid credits application."
          },
          "price_id": {
            "type": "string"
          },
          "price_type": {
            "type": "string"
          },
          "price_unit": {
            "type": "string"
          },
          "price_unit_amount": {
            "type": "string"
          },
          "price_unit_id": {
            "type": "string"
          },
          "quantity": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string"
          },
          "subscription_line_item_id": {
            "type": "string",
            "description": "sub_line_item_id links this invoice line item to the subscription_line_item that generated it."
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "usage_analytics": {
            "type": "array",
            "description": "usage_analytics contains usage analytics for this line item (legacy - grouped by source)",
            "items": {
              "$ref": "#/components/schemas/SourceUsageItem"
            }
          },
          "usage_breakdown": {
            "type": "array",
            "description": "usage_breakdown contains flexible usage breakdown for this line item (supports any grouping)",
            "items": {
              "$ref": "#/components/schemas/UsageBreakdownItem"
            }
          }
        }
      },
      "InvoicePreview": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "description": "currency is the currency for all amounts"
          },
          "due_date": {
            "type": "string",
            "description": "due_date is when the invoice would be due",
            "format": "date-time"
          },
          "line_items": {
            "type": "array",
            "description": "line_items contains preview of line items",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineItemPreview"
            }
          },
          "subtotal": {
            "type": "string",
            "description": "subtotal is the subtotal amount before taxes"
          },
          "tax_amount": {
            "type": "string",
            "description": "tax_amount is the total tax amount"
          },
          "total": {
            "type": "string",
            "description": "total is the total amount including taxes"
          }
        }
      },
      "InvoiceResponse": {
        "type": "object",
        "properties": {
          "adjustment_amount": {
            "type": "string",
            "description": "adjustment_amount is the total sum of credit notes of type \"adjustment\".\nThese are non-cash reductions applied to the invoice (e.g. goodwill credit, billing correction)."
          },
          "amount_due": {
            "type": "string",
            "description": "amount_due is the total amount that needs to be paid for this invoice"
          },
          "amount_paid": {
            "type": "string",
            "description": "amount_paid is the amount that has already been paid towards this invoice"
          },
          "amount_remaining": {
            "type": "string",
            "description": "amount_remaining is the outstanding amount still owed on this invoice (calculated as amount_due minus amount_paid)"
          },
          "billing_period": {
            "type": "string",
            "description": "billing_period describes the billing period this invoice covers (e.g., \"January 2024\", \"Q1 2024\")"
          },
          "billing_reason": {
            "type": "string",
            "description": "billing_reason indicates why this invoice was generated (e.g., \"subscription_billing\", \"manual_charge\")"
          },
          "billing_sequence": {
            "type": "integer",
            "description": "billing_sequence is the sequential number indicating the billing cycle for subscription invoices"
          },
          "coupon_applications": {
            "type": "array",
            "description": "coupon_applications contains the coupon applications associated with this invoice (overrides embedded field)",
            "items": {
              "$ref": "#/components/schemas/CouponApplicationResponse"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "description": "currency is the three-letter ISO currency code (e.g., USD, EUR, GBP) that applies to all monetary amounts on this invoice"
          },
          "customer": {
            "$ref": "#/components/schemas/CustomerResponse"
          },
          "customer_id": {
            "type": "string",
            "description": "customer_id is the ID of the customer who will receive this invoice"
          },
          "description": {
            "type": "string",
            "description": "description is an optional description or notes about this invoice"
          },
          "due_date": {
            "type": "string",
            "description": "due_date is the date when payment for this invoice is due",
            "format": "date-time"
          },
          "environment_id": {
            "type": "string",
            "description": "environment_id is the ID of the environment this invoice belongs to (for multi-environment setups)"
          },
          "finalized_at": {
            "type": "string",
            "description": "finalized_at is the timestamp when this invoice was finalized and made ready for payment",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "description": "id is the unique identifier for this invoice"
          },
          "idempotency_key": {
            "type": "string",
            "description": "idempotency_key is a unique key used to prevent duplicate invoice creation when retrying API calls"
          },
          "invoice_number": {
            "type": "string",
            "description": "invoice_number is the human-readable invoice number displayed to customers (e.g., INV-2024-001)"
          },
          "invoice_pdf_url": {
            "type": "string",
            "description": "invoice_pdf_url is the URL where customers can download the PDF version of this invoice"
          },
          "invoice_status": {
            "$ref": "#/components/schemas/types.InvoiceStatus"
          },
          "invoice_type": {
            "$ref": "#/components/schemas/types.InvoiceType"
          },
          "is_manually_edited": {
            "type": "boolean",
            "description": "is_manually_edited is true once a user has manually added, edited, or removed a line item on this draft invoice.\nOnce set, automated recomputation of this invoice's line items must no-op rather than overwrite the manual edit."
          },
          "issue_date": {
            "type": "string",
            "description": "issue_date is the user-facing date of the invoice. Defaults to created_at if not set.",
            "format": "date-time"
          },
          "last_computed_at": {
            "type": "string",
            "description": "last_computed_at is the timestamp when this invoice was last computed by ComputeInvoice",
            "format": "date-time"
          },
          "line_items": {
            "type": "array",
            "description": "line_items contains the individual items that make up this invoice (overrides embedded field)",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineItemResponse"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "overpaid_amount": {
            "type": "string",
            "description": "overpaid_amount is the amount overpaid if payment_status is OVERPAID (amount_paid - total)"
          },
          "paid_at": {
            "type": "string",
            "description": "paid_at is the timestamp when this invoice was fully paid",
            "format": "date-time"
          },
          "payment_status": {
            "$ref": "#/components/schemas/types.PaymentStatus"
          },
          "period_end": {
            "type": "string",
            "description": "period_end is the end date of the billing period covered by this invoice",
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "description": "period_start is the start date of the billing period covered by this invoice",
            "format": "date-time"
          },
          "recalculated_invoice_id": {
            "type": "string",
            "description": "recalculated_invoice_id is the ID of the replacement invoice created when this invoice was voided and recalculated.\nWhen set, it forms a parent\u2192child link from this (voided) invoice to the new replacement invoice."
          },
          "refunded_amount": {
            "type": "string",
            "description": "refunded_amount is the total sum of credit notes of type \"refund\".\nThese are actual refunds issued to the customer."
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription": {
            "$ref": "#/components/schemas/SubscriptionResponse"
          },
          "subscription_customer_id": {
            "type": "string",
            "description": "subscription_customer_id is the subscription owner's customer ID (Subscription.CustomerID).\nIt may differ from customer_id when the subscription uses an invoicing customer. Set internally; nullable in DB."
          },
          "subscription_id": {
            "type": "string",
            "description": "subscription_id is the ID of the subscription this invoice is associated with (only present for subscription-based invoices)"
          },
          "subtotal": {
            "type": "string",
            "description": "subtotal is the sum of all line items before any taxes, discounts, or additional fees"
          },
          "taxes": {
            "type": "array",
            "description": "tax_applied_records contains the tax applied records associated with this invoice",
            "items": {
              "$ref": "#/components/schemas/TaxAppliedResponse"
            }
          },
          "tenant_id": {
            "type": "string"
          },
          "total": {
            "type": "string",
            "description": "total is the final amount including taxes, fees, and discounts"
          },
          "total_discount": {
            "type": "string",
            "description": "total_discount is the sum of all coupon discounts applied to the invoice"
          },
          "total_prepaid_credits_applied": {
            "type": "string",
            "description": "total_prepaid_credits_applied is the total amount of prepaid credits applied to this invoice."
          },
          "total_tax": {
            "type": "string",
            "description": "total_tax is the sum of all taxes combined at the invoice level."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "description": "version is the version number for tracking changes to this invoice"
          },
          "voided_at": {
            "type": "string",
            "description": "voided_at is the timestamp when this invoice was voided or cancelled",
            "format": "date-time"
          }
        }
      },
      "LineItemCommitmentConfig": {
        "type": "object",
        "properties": {
          "commitment_amount": {
            "type": "number"
          },
          "commitment_duration": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "commitment_quantity": {
            "type": "number"
          },
          "commitment_time_buckets": {
            "type": "array",
            "description": "CommitmentTimeBuckets scopes commitment to specific UTC-hour windows; requires IsWindowCommitment=true.",
            "items": {
              "$ref": "#/components/schemas/CommitmentBucketRequest"
            }
          },
          "commitment_type": {
            "$ref": "#/components/schemas/types.CommitmentType"
          },
          "enable_true_up": {
            "type": "boolean",
            "description": "EnableTrueUp charges the shortfall when usage is below commitment."
          },
          "is_window_commitment": {
            "type": "boolean",
            "description": "IsWindowCommitment applies commitment per window (e.g. per day) rather than per billing period."
          },
          "overage_factor": {
            "type": "number",
            "description": "OverageFactor is a multiplier on usage beyond commitment; 1.0 = base rate."
          }
        }
      },
      "LineItemQuantityChange": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "effective_date": {
            "type": "string",
            "description": "EffectiveDate is when the quantity change takes effect.\nIf omitted, the change is effective immediately (now).",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "quantity": {
            "type": "string"
          }
        }
      },
      "LinkIntegrationMappingRequest": {
        "required": [
          "entity_id",
          "entity_type",
          "provider_entity_id",
          "provider_type"
        ],
        "type": "object",
        "properties": {
          "entity_id": {
            "maxLength": 255,
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.IntegrationEntityType"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "provider_entity_id": {
            "maxLength": 255,
            "type": "string"
          },
          "provider_type": {
            "maxLength": 50,
            "type": "string"
          }
        }
      },
      "LinkIntegrationMappingResponse": {
        "type": "object",
        "properties": {
          "mapping": {
            "$ref": "#/components/schemas/EntityIntegrationMappingResponse"
          }
        }
      },
      "ListAlertLogsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertLogResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListCostsheetResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostsheetResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListCouponAssociationsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CouponAssociationResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListEntityIntegrationMappingsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntityIntegrationMappingResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListPaymentsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListSecretsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecretResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListTasksResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaskResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "ListTaxRatesResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxRateResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        }
      },
      "MatchedMeter": {
        "type": "object",
        "properties": {
          "event_name": {
            "type": "string"
          },
          "meter": {
            "$ref": "#/components/schemas/meter.Meter"
          },
          "meter_id": {
            "type": "string"
          }
        }
      },
      "MatchedPrice": {
        "type": "object",
        "properties": {
          "meter_id": {
            "type": "string"
          },
          "price": {
            "$ref": "#/components/schemas/price.Price"
          },
          "price_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "MatchedSubscriptionLineItem": {
        "type": "object",
        "properties": {
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "is_active_for_event": {
            "type": "boolean"
          },
          "price_id": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "sub_line_item_id": {
            "type": "string"
          },
          "subscription_id": {
            "type": "string"
          },
          "subscription_line_item": {
            "$ref": "#/components/schemas/subscription.SubscriptionLineItem"
          },
          "timestamp_within_range": {
            "type": "boolean"
          }
        }
      },
      "MeterMatchingResult": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/errors.ErrorResponse"
          },
          "matched_meters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MatchedMeter"
            }
          },
          "status": {
            "$ref": "#/components/schemas/types.DebugTrackerStatus"
          }
        }
      },
      "MeterResponse": {
        "type": "object",
        "properties": {
          "aggregation": {
            "$ref": "#/components/schemas/meter.Aggregation"
          },
          "created_at": {
            "type": "string",
            "example": "2024-03-20T15:04:05Z",
            "format": "date-time"
          },
          "event_name": {
            "type": "string",
            "example": "api_request"
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/meter.Filter"
            }
          },
          "id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "name": {
            "type": "string",
            "example": "API Usage Meter"
          },
          "reset_usage": {
            "$ref": "#/components/schemas/types.ResetUsage"
          },
          "status": {
            "type": "string",
            "example": "published"
          },
          "tenant_id": {
            "type": "string",
            "example": "tenant123"
          },
          "updated_at": {
            "type": "string",
            "example": "2024-03-20T15:04:05Z",
            "format": "date-time"
          }
        }
      },
      "MeterUsageAttribution": {
        "type": "object",
        "properties": {
          "external_customer_id": {
            "type": "string"
          },
          "meter_id": {
            "type": "string"
          },
          "qty_total": {
            "type": "string"
          }
        }
      },
      "OverrideEntitlementRequest": {
        "required": [
          "entitlement_id"
        ],
        "type": "object",
        "properties": {
          "config_value": {
            "type": "object",
            "additionalProperties": true,
            "description": "ConfigValue is the config value for config features"
          },
          "entitlement_id": {
            "type": "string",
            "description": "EntitlementID references the plan/addon entitlement to override"
          },
          "is_enabled": {
            "type": "boolean",
            "description": "IsEnabled determines if the entitlement is enabled or disabled"
          },
          "static_value": {
            "type": "string",
            "description": "StaticValue is the static value for static features"
          },
          "usage_limit": {
            "type": "integer",
            "description": "UsageLimit is the new usage limit (only these 3 fields can be overridden)\nFor metered features, nil means unlimited usage"
          }
        }
      },
      "OverrideLineItemRequest": {
        "required": [
          "price_id"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount is the new price amount that overrides the original price (optional)"
          },
          "billing_model": {
            "$ref": "#/components/schemas/types.BillingModel"
          },
          "price_id": {
            "type": "string",
            "description": "PriceID references the plan price to override"
          },
          "price_unit_amount": {
            "type": "string",
            "description": "PriceUnitAmount is the amount of the price unit (for CUSTOM type, FLAT_FEE/PACKAGE billing models)"
          },
          "price_unit_tiers": {
            "type": "array",
            "description": "PriceUnitTiers are the tiers for the price unit (for CUSTOM type, TIERED billing model)",
            "items": {
              "$ref": "#/components/schemas/CreatePriceTier"
            }
          },
          "quantity": {
            "type": "string",
            "description": "Quantity for this line item (optional)"
          },
          "tier_mode": {
            "$ref": "#/components/schemas/types.BillingTier"
          },
          "tiers": {
            "type": "array",
            "description": "Tiers determines the pricing tiers for this line item",
            "items": {
              "$ref": "#/components/schemas/CreatePriceTier"
            }
          },
          "transform_quantity": {
            "$ref": "#/components/schemas/price.TransformQuantity"
          }
        }
      },
      "PaymentAttemptResponse": {
        "type": "object",
        "properties": {
          "attempt_number": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "error_message": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "payment_id": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "PaymentGatewayOptions": {
        "type": "object",
        "properties": {
          "stripe": {
            "$ref": "#/components/schemas/StripePaymentGatewayOptions"
          }
        }
      },
      "PaymentResponse": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "attempts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentAttemptResponse"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "destination_id": {
            "type": "string"
          },
          "destination_type": {
            "$ref": "#/components/schemas/types.PaymentDestinationType"
          },
          "environment_id": {
            "type": "string"
          },
          "error_message": {
            "type": "string"
          },
          "failed_at": {
            "type": "string",
            "format": "date-time"
          },
          "gateway_metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "gateway_payment_id": {
            "type": "string"
          },
          "gateway_tracking_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "idempotency_key": {
            "type": "string"
          },
          "invoice_number": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "payment_gateway": {
            "type": "string"
          },
          "payment_method_id": {
            "type": "string"
          },
          "payment_method_type": {
            "$ref": "#/components/schemas/types.PaymentMethodType"
          },
          "payment_status": {
            "$ref": "#/components/schemas/types.PaymentStatus"
          },
          "payment_url": {
            "type": "string"
          },
          "refunded_at": {
            "type": "string",
            "format": "date-time"
          },
          "save_card_and_make_default": {
            "type": "boolean"
          },
          "succeeded_at": {
            "type": "string",
            "format": "date-time"
          },
          "tenant_id": {
            "type": "string"
          },
          "track_attempts": {
            "type": "boolean"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "voided_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PlanResponse": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "credit_grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditGrantResponse"
            }
          },
          "description": {
            "type": "string"
          },
          "display_order": {
            "type": "integer"
          },
          "entitlements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntitlementResponse"
            }
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          },
          "prices": {
            "type": "array",
            "description": "TODO: Add inline addons",
            "items": {
              "$ref": "#/components/schemas/PriceResponse"
            }
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "PlanSummary": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "description of the plan"
          },
          "id": {
            "type": "string",
            "description": "id of the plan"
          },
          "lookup_key": {
            "type": "string",
            "description": "lookup_key of the plan"
          },
          "name": {
            "type": "string",
            "description": "name of the plan"
          }
        }
      },
      "PointBucket": {
        "type": "object",
        "properties": {
          "bucket_id": {
            "type": "string"
          },
          "price_id": {
            "type": "string"
          }
        }
      },
      "PriceLookupResult": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/errors.ErrorResponse"
          },
          "matched_prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MatchedPrice"
            }
          },
          "status": {
            "$ref": "#/components/schemas/types.DebugTrackerStatus"
          }
        }
      },
      "PriceResponse": {
        "type": "object",
        "properties": {
          "addon": {
            "$ref": "#/components/schemas/AddonResponse"
          },
          "amount": {
            "type": "string",
            "description": "Amount stored in main currency units (e.g., dollars, not cents)\nFor USD: 12.50 means $12.50"
          },
          "billing_cadence": {
            "$ref": "#/components/schemas/types.BillingCadence"
          },
          "billing_model": {
            "$ref": "#/components/schemas/types.BillingModel"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer",
            "description": "BillingPeriodCount is the count of the billing period ex 1, 3, 6, 12"
          },
          "conversion_rate": {
            "type": "string",
            "description": "ConversionRate is the conversion rate of the price unit to the fiat currency"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "description": "Currency 3 digit ISO currency code in lowercase ex usd, eur, gbp"
          },
          "description": {
            "type": "string",
            "description": "Description of the price"
          },
          "display_amount": {
            "type": "string",
            "description": "DisplayAmount is the formatted amount with currency symbol\nFor USD: $12.50"
          },
          "display_name": {
            "type": "string",
            "description": "DisplayName is the name of the price"
          },
          "display_price_unit_amount": {
            "type": "string",
            "description": "DisplayPriceUnitAmount is the formatted amount of the price unit"
          },
          "end_date": {
            "type": "string",
            "description": "EndDate is the end date of the price",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string",
            "description": "EntityID holds the value of the \"entity_id\" field."
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.PriceEntityType"
          },
          "environment_id": {
            "type": "string",
            "description": "EnvironmentID is the environment identifier for the price"
          },
          "group": {
            "$ref": "#/components/schemas/GroupResponse"
          },
          "group_id": {
            "type": "string",
            "description": "GroupID references the group this price belongs to"
          },
          "id": {
            "type": "string",
            "description": "ID uuid identifier for the price"
          },
          "invoice_cadence": {
            "$ref": "#/components/schemas/types.InvoiceCadence"
          },
          "lookup_key": {
            "type": "string",
            "description": "LookupKey used for looking up the price in the database"
          },
          "metadata": {
            "$ref": "#/components/schemas/price.JSONBMetadata"
          },
          "meter": {
            "$ref": "#/components/schemas/MeterResponse"
          },
          "meter_id": {
            "type": "string",
            "description": "MeterID is the id of the meter for usage based pricing"
          },
          "min_quantity": {
            "type": "string",
            "description": "MinQuantity is the minimum quantity of the price",
            "nullable": true
          },
          "parent_price_id": {
            "type": "string",
            "description": "ParentPriceID references the root price (always set for price lineage tracking)"
          },
          "plan": {
            "$ref": "#/components/schemas/PlanResponse"
          },
          "price_unit": {
            "type": "string",
            "description": "PriceUnit is the code of the price unit (e.g., 'btc', 'eth')"
          },
          "price_unit_amount": {
            "type": "string",
            "description": "PriceUnitAmount is the amount of the price unit"
          },
          "price_unit_id": {
            "type": "string",
            "description": "PriceUnitID is the id of the price unit (for CUSTOM type)"
          },
          "price_unit_tiers": {
            "type": "array",
            "description": "PriceUnitTiers are the tiers for the price unit when BillingModel is TIERED",
            "items": {
              "$ref": "#/components/schemas/price.PriceTier"
            }
          },
          "price_unit_type": {
            "$ref": "#/components/schemas/types.PriceUnitType"
          },
          "pricing_unit": {
            "$ref": "#/components/schemas/PriceUnitResponse"
          },
          "sequence": {
            "type": "integer",
            "description": "Sequence is the monotonic stamp bumped on every state change that\nsubscription line items need to react to. Read by the plan-price sync;\nset by the database (DEFAULT nextval) on create and by the price\nrepository on termination / compatibility-affecting edits."
          },
          "start_date": {
            "type": "string",
            "description": "StartDate is the start date of the price",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "tier_mode": {
            "$ref": "#/components/schemas/types.BillingTier"
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/price.PriceTier"
            }
          },
          "transform_quantity": {
            "$ref": "#/components/schemas/price.JSONBTransformQuantity"
          },
          "trial_period_days": {
            "type": "integer",
            "description": "TrialPeriodDays is the number of days for the trial period\nNote: This is only applicable for recurring prices (BILLING_CADENCE_RECURRING)"
          },
          "type": {
            "$ref": "#/components/schemas/types.PriceType"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "PriceUnitConfig": {
        "required": [
          "price_unit"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "price_unit": {
            "type": "string"
          },
          "price_unit_tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreatePriceTier"
            }
          }
        }
      },
      "PriceUnitResponse": {
        "type": "object",
        "properties": {
          "base_currency": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "conversion_rate": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "symbol": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "ProrationDetail": {
        "type": "object",
        "properties": {
          "charge_amount": {
            "type": "string"
          },
          "credit_amount": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "line_item_id": {
            "type": "string"
          },
          "original_amount": {
            "type": "string"
          },
          "plan_name": {
            "type": "string"
          },
          "price_id": {
            "type": "string"
          },
          "proration_days": {
            "type": "integer"
          }
        }
      },
      "ProrationDetails": {
        "type": "object",
        "properties": {
          "charge_amount": {
            "type": "string",
            "description": "charge_amount is the charge amount for the new subscription"
          },
          "charge_description": {
            "type": "string",
            "description": "charge_description describes what the charge is for"
          },
          "credit_amount": {
            "type": "string",
            "description": "credit_amount is the credit amount from the old subscription"
          },
          "credit_description": {
            "type": "string",
            "description": "credit_description describes what the credit is for"
          },
          "currency": {
            "type": "string",
            "description": "currency is the currency for all amounts"
          },
          "current_period_end": {
            "type": "string",
            "description": "current_period_end is the end of the current billing period",
            "format": "date-time"
          },
          "current_period_start": {
            "type": "string",
            "description": "current_period_start is the start of the current billing period",
            "format": "date-time"
          },
          "days_remaining": {
            "type": "integer",
            "description": "days_remaining is the number of days remaining in the current period"
          },
          "days_used": {
            "type": "integer",
            "description": "days_used is the number of days used in the current period"
          },
          "net_amount": {
            "type": "string",
            "description": "net_amount is the net amount (charge - credit)"
          },
          "proration_date": {
            "type": "string",
            "description": "proration_date is the date used for proration calculations",
            "format": "date-time"
          }
        }
      },
      "RegisterMarketplaceAgreementRequest": {
        "required": [
          "customer_id",
          "plan_id",
          "provider",
          "subscription_id"
        ],
        "type": "object",
        "properties": {
          "aws": {
            "$ref": "#/components/schemas/AWSMarketplaceAgreement"
          },
          "azure": {
            "$ref": "#/components/schemas/AzureMarketplaceAgreement"
          },
          "customer_id": {
            "type": "string"
          },
          "gcp": {
            "$ref": "#/components/schemas/GCPMarketplaceAgreement"
          },
          "plan_id": {
            "type": "string"
          },
          "provider": {
            "$ref": "#/components/schemas/types.SecretProvider"
          },
          "subscription_id": {
            "type": "string"
          }
        }
      },
      "RegisterMarketplaceAgreementResponse": {
        "type": "object",
        "properties": {
          "customer_mapping_id": {
            "type": "string"
          },
          "plan_mapping_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "subscription_mapping_id": {
            "type": "string"
          }
        }
      },
      "RemoveAddonRequest": {
        "required": [
          "addon_association_id"
        ],
        "type": "object",
        "properties": {
          "addon_association_id": {
            "type": "string"
          },
          "effective_date": {
            "type": "string",
            "description": "EffectiveDate defaults to period end when nil; mid-period with create_prorations issues a wallet credit.",
            "format": "date-time"
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "ScheduledTaskResponse": {
        "type": "object",
        "properties": {
          "connection_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.ScheduledTaskEntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "interval": {
            "$ref": "#/components/schemas/types.ScheduledTaskInterval"
          },
          "job_config": {
            "$ref": "#/components/schemas/types.S3JobConfig"
          },
          "status": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SecretResponse": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "display_id": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "$ref": "#/components/schemas/types.SecretProvider"
          },
          "roles": {
            "type": "array",
            "description": "RBAC roles",
            "items": {
              "type": "string"
            }
          },
          "service_account_name": {
            "type": "string",
            "description": "name of the service account (populated for service_account user_type)"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "type": {
            "$ref": "#/components/schemas/types.SecretType"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "user_id": {
            "type": "string",
            "description": "user or service account this key belongs to"
          },
          "user_type": {
            "$ref": "#/components/schemas/types.UserType"
          }
        }
      },
      "SourceUsageItem": {
        "type": "object",
        "properties": {
          "cost": {
            "type": "string",
            "description": "cost is the cost attributed to this source for the line item"
          },
          "event_count": {
            "type": "integer",
            "description": "event_count is the number of events from this source (optional)"
          },
          "percentage": {
            "type": "string",
            "description": "percentage is the percentage of total line item cost from this source (optional)"
          },
          "source": {
            "type": "string",
            "description": "source is the name of the event source"
          },
          "usage": {
            "type": "string",
            "description": "usage is the total usage amount from this source (optional, for additional context)"
          }
        }
      },
      "StripePaymentGatewayOptions": {
        "type": "object",
        "properties": {
          "tax_id_collection_enabled": {
            "type": "boolean",
            "description": "TaxIDCollectionEnabled only applies to PAYMENT_LINK Checkout Sessions."
          }
        }
      },
      "SubModifyCouponAction": {
        "type": "string",
        "enum": [
          "add",
          "remove"
        ],
        "x-enum-varnames": [
          "SubModifyCouponActionAdd",
          "SubModifyCouponActionRemove"
        ]
      },
      "SubModifyCouponParams": {
        "required": [
          "action"
        ],
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/SubModifyCouponAction"
          },
          "coupon_association_id": {
            "type": "string",
            "description": "Required when action=\"remove\". ID of the CouponAssociation to soft-delete."
          },
          "coupon_code": {
            "type": "string",
            "description": "Required for action=\"add\". Coupon code of the coupon to attach."
          },
          "end_date": {
            "type": "string",
            "description": "Optional. When the coupon association ends.",
            "format": "date-time"
          },
          "start_date": {
            "type": "string",
            "description": "Optional. When the coupon association starts; defaults to now.",
            "format": "date-time"
          },
          "subscription_id": {
            "type": "string",
            "description": "Optional. Apply at subscription level. Mutually exclusive with SubscriptionLineItemID."
          },
          "subscription_line_item_id": {
            "type": "string",
            "description": "Optional. Apply at a specific line item. Mutually exclusive with SubscriptionID."
          }
        }
      },
      "SubModifyGroupedInvoicingParams": {
        "required": [
          "action"
        ],
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/GroupedInvoicingAction"
          },
          "child_subscription_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "parent_subscription_id": {
            "type": "string",
            "description": "ParentSubscriptionID is required for action 'add'."
          }
        }
      },
      "SubModifyInheritanceRequest": {
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/InheritanceAction"
          },
          "external_customer_ids_to_inherit_subscription": {
            "type": "array",
            "description": "ExternalCustomerIDsToInheritSubscription is used for action=\"add\".",
            "items": {
              "type": "string"
            }
          },
          "external_customer_ids_to_remove": {
            "type": "array",
            "description": "ExternalCustomerIDsToRemove is used for action=\"remove\".",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SubModifyQuantityChangeRequest": {
        "required": [
          "line_items"
        ],
        "type": "object",
        "properties": {
          "line_items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LineItemQuantityChange"
            }
          }
        }
      },
      "SubModifyTaxAction": {
        "type": "string",
        "enum": [
          "add",
          "remove"
        ],
        "x-enum-varnames": [
          "SubModifyTaxActionAdd",
          "SubModifyTaxActionRemove"
        ]
      },
      "SubModifyTaxParams": {
        "required": [
          "action"
        ],
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/SubModifyTaxAction"
          },
          "effective_date": {
            "type": "string",
            "description": "Optional. When to apply the change; defaults to now if omitted.",
            "format": "date-time"
          },
          "tax_association_id": {
            "type": "string",
            "description": "Required when action=\"remove\". ID of the TaxAssociation to soft-delete."
          },
          "tax_rate_id": {
            "type": "string",
            "description": "Required when action=\"add\". ID of the active tax rate to attach."
          }
        }
      },
      "SubModifyTrialEndRequest": {
        "required": [
          "action"
        ],
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/TrialEndAction"
          },
          "new_trial_end": {
            "type": "string",
            "description": "NewTrialEnd is the new trial end date. Required when action is \"scheduled_date\".",
            "format": "date-time"
          }
        }
      },
      "SubscriptionChangeEntityPolicies": {
        "type": "object",
        "properties": {
          "addons": {
            "$ref": "#/components/schemas/EntityChangePolicy"
          }
        }
      },
      "SubscriptionChangeExecuteResponse": {
        "type": "object",
        "properties": {
          "change_type": {
            "$ref": "#/components/schemas/types.SubscriptionChangeType"
          },
          "credit_grants": {
            "type": "array",
            "description": "credit_grants contains any credit grants created for proration credits",
            "items": {
              "$ref": "#/components/schemas/CreditGrantResponse"
            }
          },
          "effective_date": {
            "type": "string",
            "description": "effective_date is when the change took effect",
            "format": "date-time"
          },
          "invoice": {
            "$ref": "#/components/schemas/InvoiceResponse"
          },
          "is_scheduled": {
            "type": "boolean",
            "description": "is_scheduled indicates if the change was scheduled or executed immediately"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "metadata from the request"
          },
          "new_subscription": {
            "$ref": "#/components/schemas/SubscriptionSummary"
          },
          "old_subscription": {
            "$ref": "#/components/schemas/SubscriptionSummary"
          },
          "proration_applied": {
            "$ref": "#/components/schemas/ProrationDetails"
          },
          "schedule_id": {
            "type": "string",
            "description": "schedule_id is the ID of the created schedule (only if is_scheduled=true)"
          },
          "scheduled_at": {
            "type": "string",
            "description": "scheduled_at is when the change will execute (only if is_scheduled=true)",
            "format": "date-time"
          }
        },
        "description": "Response after successfully executing a subscription plan change"
      },
      "SubscriptionChangePreviewResponse": {
        "type": "object",
        "properties": {
          "change_type": {
            "$ref": "#/components/schemas/types.SubscriptionChangeType"
          },
          "current_plan": {
            "$ref": "#/components/schemas/PlanSummary"
          },
          "effective_date": {
            "type": "string",
            "description": "effective_date is when the change would take effect",
            "format": "date-time"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "metadata from the request"
          },
          "new_billing_cycle": {
            "$ref": "#/components/schemas/BillingCycleInfo"
          },
          "next_invoice_preview": {
            "$ref": "#/components/schemas/InvoicePreview"
          },
          "proration_details": {
            "$ref": "#/components/schemas/ProrationDetails"
          },
          "subscription_id": {
            "type": "string",
            "description": "subscription_id is the ID of the subscription being changed"
          },
          "target_plan": {
            "$ref": "#/components/schemas/PlanSummary"
          },
          "warnings": {
            "type": "array",
            "description": "warnings contains any warnings about the change",
            "items": {
              "type": "string"
            }
          }
        },
        "description": "Response showing the financial impact of a subscription plan change"
      },
      "SubscriptionChangeRequest": {
        "required": [
          "billing_cadence",
          "billing_cycle",
          "billing_period",
          "proration_behavior",
          "target_plan_id"
        ],
        "type": "object",
        "properties": {
          "billing_cadence": {
            "$ref": "#/components/schemas/types.BillingCadence"
          },
          "billing_cycle": {
            "$ref": "#/components/schemas/types.BillingCycle"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer",
            "description": "billing_period_count is the billing period count for the new subscription"
          },
          "change_at": {
            "$ref": "#/components/schemas/types.ScheduleType"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "metadata contains additional key-value pairs for storing extra information"
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          },
          "target_plan_id": {
            "type": "string",
            "description": "target_plan_id is the ID of the new plan to change to (required)"
          }
        },
        "description": "Request object for changing a subscription plan (upgrade/downgrade)"
      },
      "SubscriptionChangeV2Request": {
        "required": [
          "proration_behavior",
          "target_plan_id"
        ],
        "type": "object",
        "properties": {
          "entity_policies": {
            "$ref": "#/components/schemas/SubscriptionChangeEntityPolicies"
          },
          "idempotency_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          },
          "target_plan_id": {
            "type": "string"
          }
        }
      },
      "SubscriptionChangeV2Response": {
        "type": "object",
        "properties": {
          "change_type": {
            "$ref": "#/components/schemas/types.SubscriptionChangeType"
          },
          "changed_resources": {
            "$ref": "#/components/schemas/ChangedResources"
          },
          "effective_at": {
            "type": "string",
            "format": "date-time"
          },
          "entity_changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntityChangeResult"
            }
          },
          "from_plan": {
            "$ref": "#/components/schemas/PlanSummary"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "subscription": {
            "$ref": "#/components/schemas/SubscriptionResponse"
          },
          "to_plan": {
            "$ref": "#/components/schemas/PlanSummary"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SubscriptionCouponInput": {
        "required": [
          "coupon_code"
        ],
        "type": "object",
        "properties": {
          "coupon_code": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "price_id": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SubscriptionEntitlementsResponse": {
        "type": "object",
        "properties": {
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AggregatedFeature"
            }
          },
          "plan_id": {
            "type": "string"
          },
          "subscription_id": {
            "type": "string"
          }
        }
      },
      "SubscriptionInheritanceConfig": {
        "type": "object",
        "properties": {
          "external_customer_ids_to_inherit_subscription": {
            "type": "array",
            "description": "ExternalCustomerIDsToInheritSubscription creates inherited skeleton subscriptions for child customers. Parent only.",
            "items": {
              "type": "string"
            }
          },
          "grouped_invoicing_children_to_create": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupedInvoicingChildRequest"
            }
          },
          "invoicing_customer_external_id": {
            "type": "string",
            "description": "InvoicingCustomerExternalID routes invoices to a different customer. Required for delegated; rejected for inherited."
          },
          "parent_subscription_id": {
            "type": "string",
            "description": "ParentSubscriptionID links to an existing parent. Required for inherited/grouped_invoicing; rejected for standalone/delegated/parent."
          },
          "subscriptions_ids_for_grouped_invoicing": {
            "type": "array",
            "description": "SubscriptionsIDsForGroupedInvoicing converts existing standalone subscriptions to grouped_invoicing under this parent. Parent only.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SubscriptionLineItemLookupResult": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/errors.ErrorResponse"
          },
          "matched_line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MatchedSubscriptionLineItem"
            }
          },
          "status": {
            "$ref": "#/components/schemas/types.DebugTrackerStatus"
          }
        }
      },
      "SubscriptionLineItemResponse": {
        "type": "object",
        "properties": {
          "addon_association_id": {
            "type": "string"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer",
            "description": "from price at create; default 1"
          },
          "commitment_amount": {
            "type": "string",
            "description": "Commitment fields"
          },
          "commitment_duration": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "commitment_overage_factor": {
            "type": "string"
          },
          "commitment_quantity": {
            "type": "string"
          },
          "commitment_time_buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.TimeOfDayBucket"
            }
          },
          "commitment_true_up_enabled": {
            "type": "boolean"
          },
          "commitment_type": {
            "$ref": "#/components/schemas/types.CommitmentType"
          },
          "commitment_windowed": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.SubscriptionLineItemEntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invoice_cadence": {
            "$ref": "#/components/schemas/types.InvoiceCadence"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "meter": {
            "$ref": "#/components/schemas/meter.Meter"
          },
          "meter_display_name": {
            "type": "string"
          },
          "meter_id": {
            "type": "string"
          },
          "plan_display_name": {
            "type": "string"
          },
          "price": {
            "$ref": "#/components/schemas/PriceResponse"
          },
          "price_id": {
            "type": "string"
          },
          "price_type": {
            "$ref": "#/components/schemas/types.PriceType"
          },
          "price_unit": {
            "type": "string"
          },
          "price_unit_id": {
            "type": "string"
          },
          "quantity": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string"
          },
          "subscription_phase_id": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "SubscriptionModifyResponse": {
        "type": "object",
        "properties": {
          "changed_resources": {
            "$ref": "#/components/schemas/ChangedResources"
          },
          "checkout_session": {
            "$ref": "#/components/schemas/CheckoutSessionResponse"
          },
          "subscription": {
            "$ref": "#/components/schemas/SubscriptionResponse"
          }
        }
      },
      "SubscriptionModifyType": {
        "type": "string",
        "enum": [
          "inheritance",
          "quantity_change",
          "grouped_invoicing",
          "trial_end",
          "coupon",
          "tax"
        ],
        "x-enum-varnames": [
          "SubscriptionModifyTypeInheritance",
          "SubscriptionModifyTypeQuantityChange",
          "SubscriptionModifyTypeGroupedInvoicing",
          "SubscriptionModifyTypeTrialEnd",
          "SubscriptionModifyTypeCoupon",
          "SubscriptionModifyTypeTax"
        ]
      },
      "SubscriptionPhaseCreateRequest": {
        "required": [
          "start_date"
        ],
        "type": "object",
        "properties": {
          "coupons": {
            "type": "array",
            "description": "Deprecated: use SubscriptionCoupons instead.",
            "items": {
              "type": "string"
            }
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "line_item_coupons": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Deprecated: use SubscriptionCoupons instead."
          },
          "line_items": {
            "type": "array",
            "description": "LineItems are extra (non-plan) line items for this phase; start_date defaults to phase start.",
            "items": {
              "$ref": "#/components/schemas/CreateSubscriptionLineItemRequest"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "override_line_items": {
            "type": "array",
            "description": "OverrideLineItems overrides specific plan prices for this phase.",
            "items": {
              "$ref": "#/components/schemas/OverrideLineItemRequest"
            }
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "subscription_coupons": {
            "type": "array",
            "description": "SubscriptionCoupons is the preferred way to attach coupons to this phase.",
            "items": {
              "$ref": "#/components/schemas/SubscriptionCouponInput"
            }
          }
        }
      },
      "SubscriptionPhaseResponse": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "description": "EndDate is when the phase ends (nil if phase is still active or indefinite)",
            "format": "date-time"
          },
          "environment_id": {
            "type": "string",
            "description": "EnvironmentID is the environment identifier for the phase"
          },
          "id": {
            "type": "string",
            "description": "ID is the unique identifier for the subscription phase"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "start_date": {
            "type": "string",
            "description": "StartDate is when the phase starts",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string",
            "description": "SubscriptionID is the identifier for the subscription"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "SubscriptionPriceCreateRequest": {
        "required": [
          "billing_model",
          "billing_period",
          "invoice_cadence",
          "price_unit_type",
          "type"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "billing_model": {
            "$ref": "#/components/schemas/types.BillingModel"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "filter_values": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "invoice_cadence": {
            "$ref": "#/components/schemas/types.InvoiceCadence"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "meter_id": {
            "type": "string"
          },
          "min_quantity": {
            "type": "integer"
          },
          "price_unit_config": {
            "$ref": "#/components/schemas/PriceUnitConfig"
          },
          "price_unit_type": {
            "$ref": "#/components/schemas/types.PriceUnitType"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "tier_mode": {
            "$ref": "#/components/schemas/types.BillingTier"
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreatePriceTier"
            }
          },
          "transform_quantity": {
            "$ref": "#/components/schemas/price.TransformQuantity"
          },
          "trial_period_days": {
            "type": "integer"
          },
          "type": {
            "$ref": "#/components/schemas/types.PriceType"
          }
        }
      },
      "SubscriptionResponse": {
        "type": "object",
        "properties": {
          "active_pause_id": {
            "type": "string",
            "description": "ActivePauseID references the current active pause configuration\nThis will be null if no pause is active or scheduled"
          },
          "auto_invoice_threshold": {
            "type": "string",
            "description": "AutoInvoiceThreshold is the usage amount (in subscription currency) that triggers\nan intermediate invoice. Overrides the plan-level threshold when set.\nNil means: inherit from the plan's threshold (which may also be nil = disabled)."
          },
          "billing_anchor": {
            "type": "string",
            "description": "BillingAnchor is the reference point that aligns future billing cycle dates.\nIt sets the day of week for week intervals, the day of month for month and year intervals,\nand the month of year for year intervals. The timestamp is in UTC format.",
            "format": "date-time"
          },
          "billing_cadence": {
            "$ref": "#/components/schemas/types.BillingCadence"
          },
          "billing_cycle": {
            "$ref": "#/components/schemas/types.BillingCycle"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer",
            "description": "BillingPeriodCount is the total number units of the billing period."
          },
          "cancel_at": {
            "type": "string",
            "description": "CancelAt is the date the subscription will be canceled",
            "format": "date-time"
          },
          "cancel_at_period_end": {
            "type": "boolean",
            "description": "CancelAtPeriodEnd is whether the subscription was canceled at the end of the current period"
          },
          "cancelled_at": {
            "type": "string",
            "description": "CanceledAt is the date the subscription was canceled",
            "format": "date-time"
          },
          "checkout_session": {
            "$ref": "#/components/schemas/CheckoutSessionResponse"
          },
          "collection_method": {
            "type": "string",
            "description": "CollectionMethod determines how invoices are collected"
          },
          "commitment_amount": {
            "type": "string",
            "description": "CommitmentAmount is the minimum amount a customer commits to paying for a billing period"
          },
          "commitment_duration": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "coupon_associations": {
            "type": "array",
            "description": "CouponAssociations are the coupon associations for this subscription",
            "items": {
              "$ref": "#/components/schemas/CouponAssociationResponse"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "credit_grants": {
            "type": "array",
            "description": "Credit grants are the credit grants for this subscription",
            "items": {
              "$ref": "#/components/schemas/CreditGrantResponse"
            }
          },
          "currency": {
            "type": "string",
            "description": "Currency is the currency of the subscription in lowercase 3 digit ISO codes"
          },
          "current_period_end": {
            "type": "string",
            "description": "CurrentPeriodEnd is the end of the current period that the subscription has been invoiced for.\nAt the end of this period, a new invoice will be created.",
            "format": "date-time"
          },
          "current_period_start": {
            "type": "string",
            "description": "CurrentPeriodStart is the end of the current period that the subscription has been invoiced for.\nAt the end of this period, a new invoice will be created.",
            "format": "date-time"
          },
          "customer": {
            "$ref": "#/components/schemas/CustomerResponse"
          },
          "customer_id": {
            "type": "string",
            "description": "CustomerID is the identifier for the customer in our system"
          },
          "enable_true_up": {
            "type": "boolean"
          },
          "end_date": {
            "type": "string",
            "description": "EndDate is the end date of the subscription",
            "format": "date-time"
          },
          "entitlements": {
            "type": "array",
            "description": "Entitlements is populated only when the caller adds \"entitlements\" to\nthe search filter's expand string. Each entry is a feature with its\naggregated entitlement info (same shape as CustomerEntitlementsResponse.Features).",
            "items": {
              "$ref": "#/components/schemas/AggregatedFeature"
            }
          },
          "environment_id": {
            "type": "string",
            "description": "EnvironmentID is the environment identifier for the subscription"
          },
          "gateway_payment_method_id": {
            "type": "string",
            "description": "GatewayPaymentMethodID is the gateway payment method ID for this subscription"
          },
          "id": {
            "type": "string",
            "description": "ID is the unique identifier for the subscription"
          },
          "invoicing_customer_id": {
            "type": "string",
            "description": "InvoicingCustomerID is the customer ID to use for invoicing\nThis can differ from the subscription customer (e.g., parent company invoicing for child company)"
          },
          "latest_invoice": {
            "$ref": "#/components/schemas/InvoiceResponse"
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/subscription.SubscriptionLineItem"
            }
          },
          "lookup_key": {
            "type": "string",
            "description": "LookupKey is the key used to lookup the subscription in our system"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "overage_factor": {
            "type": "string",
            "description": "OverageFactor is a multiplier applied to usage beyond the commitment amount"
          },
          "parent_subscription_id": {
            "type": "string",
            "description": "ParentSubscriptionID is the parent subscription ID for hierarchy (e.g. child subscription under a parent)"
          },
          "pause_status": {
            "$ref": "#/components/schemas/types.PauseStatus"
          },
          "pauses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/subscription.SubscriptionPause"
            }
          },
          "payment_behavior": {
            "type": "string",
            "description": "PaymentBehavior determines how subscription payments are handled"
          },
          "payment_terms": {
            "$ref": "#/components/schemas/types.PaymentTerms"
          },
          "phases": {
            "type": "array",
            "description": "Phases are the subscription phases for this subscription",
            "items": {
              "$ref": "#/components/schemas/SubscriptionPhaseResponse"
            }
          },
          "plan": {
            "$ref": "#/components/schemas/PlanResponse"
          },
          "plan_id": {
            "type": "string",
            "description": "PlanID is the identifier for the plan in our system"
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          },
          "start_date": {
            "type": "string",
            "description": "StartDate is the start date of the subscription",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_status": {
            "$ref": "#/components/schemas/types.SubscriptionStatus"
          },
          "subscription_type": {
            "$ref": "#/components/schemas/types.SubscriptionType"
          },
          "synced_price_sequence": {
            "type": "integer",
            "description": "SyncedPriceSequence is the plan-price sequence up to which this\nsubscription's line items have been reconciled. Bumped by the\nplan-price sync after a successful pass."
          },
          "tenant_id": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "trial_end": {
            "type": "string",
            "description": "TrialEnd is the end date of the trial period",
            "format": "date-time"
          },
          "trial_start": {
            "type": "string",
            "description": "TrialStart is the start date of the trial period",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "description": "Version is used for optimistic locking"
          }
        }
      },
      "SubscriptionResponseV2": {
        "type": "object",
        "properties": {
          "active_pause_id": {
            "type": "string",
            "description": "ActivePauseID references the current active pause configuration\nThis will be null if no pause is active or scheduled"
          },
          "auto_invoice_threshold": {
            "type": "string",
            "description": "AutoInvoiceThreshold is the usage amount (in subscription currency) that triggers\nan intermediate invoice. Overrides the plan-level threshold when set.\nNil means: inherit from the plan's threshold (which may also be nil = disabled)."
          },
          "billing_anchor": {
            "type": "string",
            "description": "BillingAnchor is the reference point that aligns future billing cycle dates.\nIt sets the day of week for week intervals, the day of month for month and year intervals,\nand the month of year for year intervals. The timestamp is in UTC format.",
            "format": "date-time"
          },
          "billing_cadence": {
            "$ref": "#/components/schemas/types.BillingCadence"
          },
          "billing_cycle": {
            "$ref": "#/components/schemas/types.BillingCycle"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer",
            "description": "BillingPeriodCount is the total number units of the billing period."
          },
          "cancel_at": {
            "type": "string",
            "description": "CancelAt is the date the subscription will be canceled",
            "format": "date-time"
          },
          "cancel_at_period_end": {
            "type": "boolean",
            "description": "CancelAtPeriodEnd is whether the subscription was canceled at the end of the current period"
          },
          "cancelled_at": {
            "type": "string",
            "description": "CanceledAt is the date the subscription was canceled",
            "format": "date-time"
          },
          "collection_method": {
            "type": "string",
            "description": "CollectionMethod determines how invoices are collected"
          },
          "commitment_amount": {
            "type": "string",
            "description": "CommitmentAmount is the minimum amount a customer commits to paying for a billing period"
          },
          "commitment_duration": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "coupon_associations": {
            "type": "array",
            "description": "CouponAssociations are included when \"coupon_associations\" is in expand parameter",
            "items": {
              "$ref": "#/components/schemas/CouponAssociationResponse"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "credit_grants": {
            "type": "array",
            "description": "CreditGrants are included when \"credit_grants\" is in expand parameter",
            "items": {
              "$ref": "#/components/schemas/CreditGrantResponse"
            }
          },
          "currency": {
            "type": "string",
            "description": "Currency is the currency of the subscription in lowercase 3 digit ISO codes"
          },
          "current_period_end": {
            "type": "string",
            "description": "CurrentPeriodEnd is the end of the current period that the subscription has been invoiced for.\nAt the end of this period, a new invoice will be created.",
            "format": "date-time"
          },
          "current_period_start": {
            "type": "string",
            "description": "CurrentPeriodStart is the end of the current period that the subscription has been invoiced for.\nAt the end of this period, a new invoice will be created.",
            "format": "date-time"
          },
          "customer": {
            "$ref": "#/components/schemas/CustomerResponse"
          },
          "customer_id": {
            "type": "string",
            "description": "CustomerID is the identifier for the customer in our system"
          },
          "enable_true_up": {
            "type": "boolean"
          },
          "end_date": {
            "type": "string",
            "description": "EndDate is the end date of the subscription",
            "format": "date-time"
          },
          "environment_id": {
            "type": "string",
            "description": "EnvironmentID is the environment identifier for the subscription"
          },
          "gateway_payment_method_id": {
            "type": "string",
            "description": "GatewayPaymentMethodID is the gateway payment method ID for this subscription"
          },
          "id": {
            "type": "string",
            "description": "ID is the unique identifier for the subscription"
          },
          "invoicing_customer_id": {
            "type": "string",
            "description": "InvoicingCustomerID is the customer ID to use for invoicing\nThis can differ from the subscription customer (e.g., parent company invoicing for child company)"
          },
          "line_items": {
            "type": "array",
            "description": "LineItems is expanded only if \"subscription_line_items\" is in expand parameter\nEach line item can optionally include expanded price data",
            "items": {
              "$ref": "#/components/schemas/SubscriptionLineItemResponse"
            }
          },
          "lookup_key": {
            "type": "string",
            "description": "LookupKey is the key used to lookup the subscription in our system"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "overage_factor": {
            "type": "string",
            "description": "OverageFactor is a multiplier applied to usage beyond the commitment amount"
          },
          "parent_subscription_id": {
            "type": "string",
            "description": "ParentSubscriptionID is the parent subscription ID for hierarchy (e.g. child subscription under a parent)"
          },
          "pause_status": {
            "$ref": "#/components/schemas/types.PauseStatus"
          },
          "pauses": {
            "type": "array",
            "description": "Pauses are included when subscription has pause status",
            "items": {
              "$ref": "#/components/schemas/subscription.SubscriptionPause"
            }
          },
          "payment_behavior": {
            "type": "string",
            "description": "PaymentBehavior determines how subscription payments are handled"
          },
          "payment_terms": {
            "$ref": "#/components/schemas/types.PaymentTerms"
          },
          "phases": {
            "type": "array",
            "description": "Phases are included when \"phases\" is in expand parameter",
            "items": {
              "$ref": "#/components/schemas/SubscriptionPhaseResponse"
            }
          },
          "plan": {
            "$ref": "#/components/schemas/PlanResponse"
          },
          "plan_id": {
            "type": "string",
            "description": "PlanID is the identifier for the plan in our system"
          },
          "plan_prices_out_of_sync": {
            "type": "boolean",
            "description": "PlanPricesOutOfSync is true when the subscription's synced_price_sequence\nis behind the plan's current max prices.sequence \u2014 i.e. plan-price\nchanges have not yet been reconciled into this subscription's line items."
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          },
          "start_date": {
            "type": "string",
            "description": "StartDate is the start date of the subscription",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_status": {
            "$ref": "#/components/schemas/types.SubscriptionStatus"
          },
          "subscription_type": {
            "$ref": "#/components/schemas/types.SubscriptionType"
          },
          "synced_price_sequence": {
            "type": "integer",
            "description": "SyncedPriceSequence is the plan-price sequence up to which this\nsubscription's line items have been reconciled. Bumped by the\nplan-price sync after a successful pass."
          },
          "tenant_id": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "trial_end": {
            "type": "string",
            "description": "TrialEnd is the end date of the trial period",
            "format": "date-time"
          },
          "trial_start": {
            "type": "string",
            "description": "TrialStart is the start date of the trial period",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "description": "Version is used for optimistic locking"
          }
        }
      },
      "SubscriptionScheduleResponse": {
        "type": "object",
        "properties": {
          "can_be_cancelled": {
            "type": "boolean",
            "description": "can_be_cancelled indicates if the schedule can be cancelled"
          },
          "cancelled_at": {
            "type": "string",
            "description": "cancelled_at is when the schedule was cancelled",
            "format": "date-time"
          },
          "configuration": {
            "type": "object",
            "description": "configuration contains type-specific configuration (e.g., target_plan_id for plan changes)"
          },
          "created_at": {
            "type": "string",
            "description": "created_at timestamp",
            "format": "date-time"
          },
          "days_until_execution": {
            "type": "integer",
            "description": "days_until_execution is the number of days until execution"
          },
          "error_message": {
            "type": "string",
            "description": "error_message contains the error if execution failed"
          },
          "executed_at": {
            "type": "string",
            "description": "executed_at is when the schedule was executed",
            "format": "date-time"
          },
          "execution_result": {
            "type": "object",
            "description": "execution_result contains type-specific execution result"
          },
          "id": {
            "type": "string",
            "description": "id of the schedule"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "metadata from the schedule"
          },
          "schedule_type": {
            "$ref": "#/components/schemas/types.SubscriptionScheduleChangeType"
          },
          "scheduled_at": {
            "type": "string",
            "description": "scheduled_at is when the schedule will execute",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.ScheduleStatus"
          },
          "subscription_id": {
            "type": "string",
            "description": "subscription_id is the ID of the subscription"
          },
          "updated_at": {
            "type": "string",
            "description": "updated_at timestamp",
            "format": "date-time"
          }
        },
        "description": "Full details of a subscription schedule"
      },
      "SubscriptionSummary": {
        "type": "object",
        "properties": {
          "archived_at": {
            "type": "string",
            "description": "archived_at timestamp (for old subscriptions)",
            "format": "date-time"
          },
          "billing_anchor": {
            "type": "string",
            "description": "billing_anchor of the subscription",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "description": "created_at timestamp",
            "format": "date-time"
          },
          "current_period_end": {
            "type": "string",
            "description": "current_period_end of the subscription",
            "format": "date-time"
          },
          "current_period_start": {
            "type": "string",
            "description": "current_period_start of the subscription",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "description": "id of the subscription"
          },
          "plan_id": {
            "type": "string",
            "description": "plan_id of the subscription"
          },
          "status": {
            "$ref": "#/components/schemas/types.SubscriptionStatus"
          }
        }
      },
      "SubscriptionUsageByMetersResponse": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "display_amount": {
            "type": "string"
          },
          "filter_values": {
            "$ref": "#/components/schemas/price.JSONBFilters"
          },
          "is_overage": {
            "type": "boolean",
            "description": "Whether this charge is at overage rate"
          },
          "meter_display_name": {
            "type": "string"
          },
          "meter_id": {
            "type": "string"
          },
          "overage_factor": {
            "type": "number",
            "description": "Factor applied to this charge if in overage"
          },
          "price": {
            "$ref": "#/components/schemas/price.Price"
          },
          "quantity": {
            "type": "number"
          },
          "subscription_line_item_id": {
            "type": "string",
            "description": "For feature_usage: direct match by sub_line_item_id"
          }
        }
      },
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "TaskResponse": {
        "type": "object",
        "properties": {
          "completed_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.EntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "error_summary": {
            "type": "string"
          },
          "failed_at": {
            "type": "string",
            "format": "date-time"
          },
          "failed_records": {
            "type": "integer"
          },
          "file_name": {
            "type": "string"
          },
          "file_type": {
            "$ref": "#/components/schemas/types.FileType"
          },
          "file_url": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "processed_records": {
            "type": "integer"
          },
          "scheduled_task_id": {
            "type": "string"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "successful_records": {
            "type": "integer"
          },
          "task_status": {
            "$ref": "#/components/schemas/types.TaskStatus"
          },
          "task_type": {
            "$ref": "#/components/schemas/types.TaskType"
          },
          "tenant_id": {
            "type": "string"
          },
          "total_records": {
            "type": "integer"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "workflow_id": {
            "type": "string"
          }
        }
      },
      "TaxAppliedResponse": {
        "type": "object",
        "properties": {
          "applied_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.TaxRateEntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "idempotency_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tax_amount": {
            "type": "string"
          },
          "tax_association_id": {
            "type": "string"
          },
          "tax_rate": {
            "$ref": "#/components/schemas/TaxRateResponse"
          },
          "tax_rate_id": {
            "type": "string"
          },
          "taxable_amount": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "TaxAssociationResponse": {
        "type": "object",
        "properties": {
          "auto_apply": {
            "type": "boolean",
            "description": "Whether this tax should be automatically applied"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "description": "Currency"
          },
          "end_date": {
            "type": "string",
            "description": "EndDate is the optional date until which this association is active",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string",
            "description": "ID of the entity this tax rate applies to"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.TaxRateEntityType"
          },
          "environment_id": {
            "type": "string",
            "description": "EnvironmentID is the ID of the environment this tax rate config belongs to"
          },
          "id": {
            "type": "string",
            "description": "ID of the ent."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Metadata holds the value of the \"metadata\" field."
          },
          "priority": {
            "type": "integer",
            "description": "Priority for tax resolution (lower number = higher priority)"
          },
          "start_date": {
            "type": "string",
            "description": "StartDate is the date from which this association is active",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tax_rate": {
            "$ref": "#/components/schemas/TaxRateResponse"
          },
          "tax_rate_id": {
            "type": "string",
            "description": "Reference to the TaxRate entity"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "TaxAssociationUpdateRequest": {
        "type": "object",
        "properties": {
          "auto_apply": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "priority": {
            "type": "integer"
          }
        }
      },
      "TaxRateOverride": {
        "required": [
          "currency",
          "tax_rate_code"
        ],
        "type": "object",
        "properties": {
          "auto_apply": {
            "type": "boolean",
            "default": true
          },
          "currency": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "priority": {
            "type": "integer"
          },
          "tax_rate_code": {
            "type": "string"
          }
        }
      },
      "TaxRateResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "fixed_value": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "percentage_value": {
            "type": "string"
          },
          "scope": {
            "$ref": "#/components/schemas/types.TaxRateScope"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tax_rate_status": {
            "$ref": "#/components/schemas/types.TaxRateStatus"
          },
          "tax_rate_type": {
            "$ref": "#/components/schemas/types.TaxRateType"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "TenantBillingDetails": {
        "type": "object",
        "properties": {
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "email": {
            "type": "string"
          },
          "help_email": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        }
      },
      "TenantBillingUsage": {
        "type": "object",
        "properties": {
          "subscriptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionResponse"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/CustomerUsageSummaryResponse"
          }
        }
      },
      "TenantResponse": {
        "type": "object",
        "properties": {
          "billing_details": {
            "$ref": "#/components/schemas/TenantBillingDetails"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TopUpWalletRequest": {
        "required": [
          "transaction_reason"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "amount is the amount in the currency of the wallet to be added\nNOTE: this is not the number of credits to add, but the amount in the currency\namount = credits_to_add * conversion_rate\nif both amount and credits_to_add are provided, amount will be ignored\nex if the wallet has a conversion_rate of 2 then adding an amount of\n10 USD in the wallet wil add 5 credits in the wallet"
          },
          "bonus_credits_expiry_date_utc": {
            "type": "string",
            "description": "bonus_credits_expiry_date_utc is the expiry (UTC, full precision) applied to the bonus\ncredits transaction. Independent of expiry_date_utc, which governs the purchase credits.\nOnly honored when bonus credits are actually granted (explicit BonusCreditsToAdd or slab)."
          },
          "bonus_credits_to_add": {
            "type": "string",
            "description": "bonus_credits_to_add is an explicit override for the bonus credits granted alongside this\npurchase. When nil/omitted, the bonus is resolved from the tenant's\nbonus_credits_topup_config slabs (if enabled). When set, it must be greater than 0 and is\nused as-is, skipping slab resolution. To grant no bonus, omit this field entirely."
          },
          "checkout": {
            "$ref": "#/components/schemas/CheckoutParams"
          },
          "credits_to_add": {
            "type": "string",
            "description": "credits_to_add is the number of credits to add to the wallet"
          },
          "description": {
            "type": "string",
            "description": "description to add any specific details about the transaction"
          },
          "expiry_date_utc": {
            "type": "string",
            "description": "expiry_date_utc is the expiry date in UTC timezone\nex 2025-01-01 00:00:00 UTC"
          },
          "force_sync_invoice": {
            "type": "boolean"
          },
          "idempotency_key": {
            "type": "string",
            "description": "idempotency_key is a unique key for the transaction"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "priority": {
            "type": "integer",
            "description": "priority is the priority of the transaction\nlower number means higher priority\ndefault is nil which means no priority at all"
          },
          "transaction_reason": {
            "$ref": "#/components/schemas/types.TransactionReason"
          }
        }
      },
      "TopUpWalletResponse": {
        "type": "object",
        "properties": {
          "checkout_session": {
            "$ref": "#/components/schemas/CheckoutSessionResponse"
          },
          "invoice_id": {
            "type": "string",
            "description": "Invoice ID if an invoice was created (only for PURCHASED_CREDIT_INVOICED)"
          },
          "wallet": {
            "$ref": "#/components/schemas/WalletResponse"
          },
          "wallet_transaction": {
            "$ref": "#/components/schemas/WalletTransactionResponse"
          }
        }
      },
      "TrialEndAction": {
        "type": "string",
        "enum": [
          "immediate",
          "scheduled_date"
        ],
        "x-enum-varnames": [
          "TrialEndActionImmediate",
          "TrialEndActionScheduledDate"
        ]
      },
      "TriggerForceRunRequest": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TriggerForceRunResponse": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "message": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "description": "\"custom\" or \"automatic\""
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "workflow_id": {
            "type": "string"
          }
        }
      },
      "UpdateAddonRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "name": {
            "type": "string"
          }
        }
      },
      "UpdateAlertSettingsRequest": {
        "required": [
          "config"
        ],
        "type": "object",
        "properties": {
          "config": {
            "$ref": "#/components/schemas/types.AlertSettings"
          }
        }
      },
      "UpdateCostsheetRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "lookup_key": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          }
        }
      },
      "UpdateCostsheetResponse": {
        "type": "object",
        "properties": {
          "costsheet": {
            "$ref": "#/components/schemas/CostsheetResponse"
          }
        }
      },
      "UpdateCouponRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          }
        }
      },
      "UpdateCreditGrantRequest": {
        "type": "object",
        "properties": {
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "UpdateCustomerRequest": {
        "type": "object",
        "properties": {
          "address_city": {
            "maxLength": 100,
            "type": "string",
            "description": "address_city is the updated city name with maximum 100 characters"
          },
          "address_country": {
            "type": "string",
            "description": "address_country is the updated two-letter ISO 3166-1 alpha-2 country code"
          },
          "address_line1": {
            "maxLength": 255,
            "type": "string",
            "description": "address_line1 is the updated primary address line with maximum 255 characters"
          },
          "address_line2": {
            "maxLength": 255,
            "type": "string",
            "description": "address_line2 is the updated secondary address line with maximum 255 characters"
          },
          "address_postal_code": {
            "maxLength": 20,
            "type": "string",
            "description": "address_postal_code is the updated postal code with maximum 20 characters"
          },
          "address_state": {
            "maxLength": 100,
            "type": "string",
            "description": "address_state is the updated state, province, or region name with maximum 100 characters"
          },
          "contact": {
            "maxLength": 20,
            "type": "string",
            "description": "contact is the updated contact number for the customer (e.g. phone)"
          },
          "email": {
            "type": "string",
            "description": "email is the updated email address and must be a valid email format if provided"
          },
          "external_id": {
            "type": "string",
            "description": "external_id is the updated external identifier for the customer"
          },
          "integration_entity_mapping": {
            "type": "array",
            "description": "integration_entity_mapping contains provider integration mappings for this customer",
            "items": {
              "$ref": "#/components/schemas/CreateEntityIntegrationMappingRequest"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "metadata contains updated key-value pairs that will replace existing metadata"
          },
          "name": {
            "type": "string",
            "description": "name is the updated name or company name for the customer"
          },
          "timezone": {
            "type": "string",
            "description": "timezone is the updated IANA timezone name for the customer (e.g. \"Asia/Kolkata\", \"America/New_York\")"
          }
        },
        "description": "Request object for updating an existing customer. All fields are optional - only provided fields will be updated"
      },
      "UpdateEntitlementRequest": {
        "type": "object",
        "properties": {
          "aggregation_mode": {
            "$ref": "#/components/schemas/types.EntitlementAggregationMode"
          },
          "clear_grant_config": {
            "type": "boolean",
            "description": "Grant config \u2014 nil fields leave the current value alone.\nClearGrantConfig=true wipes the whole grant config (back to a legacy entitlement)."
          },
          "config_value": {
            "type": "object",
            "additionalProperties": true
          },
          "grant_duration_unit": {
            "$ref": "#/components/schemas/types.EntitlementGrantDurationUnit"
          },
          "grant_duration_value": {
            "type": "integer"
          },
          "grant_measure": {
            "$ref": "#/components/schemas/types.EntitlementGrantMeasure"
          },
          "grant_quota": {
            "type": "string"
          },
          "is_enabled": {
            "type": "boolean"
          },
          "is_soft_limit": {
            "type": "boolean"
          },
          "static_value": {
            "type": "string"
          },
          "usage_limit": {
            "type": "integer"
          },
          "usage_reset_period": {
            "$ref": "#/components/schemas/types.EntitlementUsageResetPeriod"
          }
        }
      },
      "UpdateFeatureRequest": {
        "type": "object",
        "properties": {
          "alert_settings": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "description": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/meter.Filter"
            }
          },
          "group_id": {
            "type": "string",
            "description": "GroupID is the id of the group to assign the feature to. Pass empty string to clear."
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          },
          "reporting_unit": {
            "$ref": "#/components/schemas/types.ReportingUnit"
          },
          "unit_plural": {
            "type": "string"
          },
          "unit_singular": {
            "type": "string"
          }
        }
      },
      "UpdateInvoiceRequest": {
        "type": "object",
        "properties": {
          "apply_discount": {
            "type": "boolean",
            "description": "When true, recalculates discount from existing coupon associations (draft invoices only)."
          },
          "due_date": {
            "type": "string",
            "format": "date-time"
          },
          "invoice_pdf_url": {
            "type": "string",
            "description": "invoice_pdf_url is the URL where customers can download the PDF version of this invoice"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          }
        }
      },
      "UpdatePaymentRequest": {
        "type": "object",
        "properties": {
          "error_message": {
            "type": "string"
          },
          "failed_at": {
            "type": "string",
            "format": "date-time"
          },
          "gateway_payment_id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "payment_gateway": {
            "type": "string"
          },
          "payment_method_id": {
            "type": "string"
          },
          "payment_status": {
            "type": "string"
          },
          "refunded_at": {
            "type": "string",
            "format": "date-time"
          },
          "succeeded_at": {
            "type": "string",
            "format": "date-time"
          },
          "voided_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UpdatePaymentStatusRequest": {
        "required": [
          "payment_status"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "amount is the optional payment amount to record"
          },
          "payment_status": {
            "$ref": "#/components/schemas/types.PaymentStatus"
          }
        }
      },
      "UpdatePlanRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "display_order": {
            "type": "integer"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "UpdatePriceRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount is the new price amount that overrides the original price (optional)"
          },
          "billing_model": {
            "$ref": "#/components/schemas/types.BillingModel"
          },
          "description": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "effective_from": {
            "type": "string"
          },
          "group_id": {
            "type": "string",
            "description": "GroupID is the id of the group to update the price in.\nIf not provided (nil), the group will not be changed\nIf provided as empty string (\"\"), the group will be removed (price will be ungrouped)\nIf provided as a group ID, the price will be assigned to that group (must exist and be published)"
          },
          "lookup_key": {
            "type": "string",
            "description": "All price fields that can be updated\nNon-critical fields (can be updated directly)"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "price_unit_amount": {
            "type": "string",
            "description": "PriceUnitAmount is the price unit amount (for CUSTOM price unit type, FLAT_FEE/PACKAGE billing models)"
          },
          "price_unit_tiers": {
            "type": "array",
            "description": "PriceUnitTiers are the price unit tiers (for CUSTOM price unit type, TIERED billing model)",
            "items": {
              "$ref": "#/components/schemas/CreatePriceTier"
            }
          },
          "tier_mode": {
            "$ref": "#/components/schemas/types.BillingTier"
          },
          "tiers": {
            "type": "array",
            "description": "Tiers determines the pricing tiers for this line item",
            "items": {
              "$ref": "#/components/schemas/CreatePriceTier"
            }
          },
          "transform_quantity": {
            "$ref": "#/components/schemas/price.TransformQuantity"
          }
        }
      },
      "UpdatePriceUnitRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "UpdateScheduledTaskRequest": {
        "required": [
          "enabled"
        ],
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "UpdateServiceAccountRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "UpdateServiceAccountResponse": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Empty for service accounts"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tenant": {
            "$ref": "#/components/schemas/TenantResponse"
          },
          "type": {
            "$ref": "#/components/schemas/types.UserType"
          }
        }
      },
      "UpdateSubscriptionLineItemRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount is the new price amount that overrides the original price"
          },
          "billing_model": {
            "$ref": "#/components/schemas/types.BillingModel"
          },
          "commitment_amount": {
            "type": "number",
            "description": "Commitment fields"
          },
          "commitment_duration": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "commitment_overage_factor": {
            "type": "number"
          },
          "commitment_quantity": {
            "type": "number"
          },
          "commitment_time_buckets": {
            "type": "array",
            "description": "Pointer so an explicit empty array can clear existing buckets (omission keeps them).",
            "items": {
              "$ref": "#/components/schemas/CommitmentBucketRequest"
            }
          },
          "commitment_true_up_enabled": {
            "type": "boolean"
          },
          "commitment_type": {
            "$ref": "#/components/schemas/types.CommitmentType"
          },
          "commitment_windowed": {
            "type": "boolean"
          },
          "effective_from": {
            "type": "string",
            "description": "EffectiveFrom for the existing line item (if not provided, defaults to now)"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Metadata for the new line item"
          },
          "tier_mode": {
            "$ref": "#/components/schemas/types.BillingTier"
          },
          "tiers": {
            "type": "array",
            "description": "Tiers determines the pricing tiers for this line item",
            "items": {
              "$ref": "#/components/schemas/CreatePriceTier"
            }
          },
          "transform_quantity": {
            "$ref": "#/components/schemas/price.TransformQuantity"
          }
        }
      },
      "UpdateSubscriptionRequest": {
        "type": "object",
        "properties": {
          "cancel_at": {
            "type": "string",
            "format": "date-time"
          },
          "cancel_at_period_end": {
            "type": "boolean"
          },
          "parent_subscription_id": {
            "type": "string",
            "description": "ParentSubscriptionID sets or clears the parent subscription. Omit to leave unchanged; send \"\" to clear."
          },
          "status": {
            "$ref": "#/components/schemas/types.SubscriptionStatus"
          }
        }
      },
      "UpdateTaskStatusRequest": {
        "required": [
          "task_status"
        ],
        "type": "object",
        "properties": {
          "task_status": {
            "$ref": "#/components/schemas/types.TaskStatus"
          }
        }
      },
      "UpdateTaxRateRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "code is the updated unique alphanumeric identifier for the tax rate"
          },
          "description": {
            "type": "string",
            "description": "description is the updated text description for the tax rate"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "metadata contains updated key-value pairs that will replace existing metadata"
          },
          "name": {
            "type": "string",
            "description": "name is the updated human-readable name for the tax rate"
          },
          "tax_rate_status": {
            "$ref": "#/components/schemas/types.TaxRateStatus"
          }
        }
      },
      "UpdateTenantRequest": {
        "type": "object",
        "properties": {
          "billing_details": {
            "$ref": "#/components/schemas/TenantBillingDetails"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "UpdateUserRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          }
        }
      },
      "UpdateUserResponse": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Empty for service accounts"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tenant": {
            "$ref": "#/components/schemas/TenantResponse"
          },
          "type": {
            "$ref": "#/components/schemas/types.UserType"
          }
        }
      },
      "UpdateUserRolesRequest": {
        "type": "object",
        "properties": {
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UpdateUserRolesResponse": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Empty for service accounts"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tenant": {
            "$ref": "#/components/schemas/TenantResponse"
          },
          "type": {
            "$ref": "#/components/schemas/types.UserType"
          }
        }
      },
      "UpdateWalletRequest": {
        "type": "object",
        "properties": {
          "alert_settings": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "auto_topup": {
            "$ref": "#/components/schemas/types.AutoTopup"
          },
          "config": {
            "$ref": "#/components/schemas/types.WalletConfig"
          },
          "description": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "UsageAnalyticItem": {
        "type": "object",
        "properties": {
          "add_on_id": {
            "type": "string"
          },
          "addon": {
            "$ref": "#/components/schemas/Addon"
          },
          "aggregation_type": {
            "$ref": "#/components/schemas/types.AggregationType"
          },
          "bucket_summaries": {
            "type": "array",
            "description": "BucketSummaries is populated only when BreakdownBucket=true. Contains one\nentry per defined CommitmentTimeBucket plus one for out-of-bucket usage.",
            "items": {
              "$ref": "#/components/schemas/BucketSummary"
            }
          },
          "commitment_info": {
            "$ref": "#/components/schemas/types.CommitmentInfo"
          },
          "currency": {
            "type": "string"
          },
          "event_count": {
            "type": "integer",
            "description": "Number of events that contributed to this aggregation"
          },
          "event_name": {
            "type": "string"
          },
          "feature": {
            "$ref": "#/components/schemas/Feature"
          },
          "feature_id": {
            "type": "string"
          },
          "group": {
            "$ref": "#/components/schemas/group.Group"
          },
          "meter": {
            "$ref": "#/components/schemas/meter.Meter"
          },
          "meter_id": {
            "type": "string",
            "description": "Meter ID"
          },
          "name": {
            "type": "string"
          },
          "plan": {
            "$ref": "#/components/schemas/Plan"
          },
          "plan_id": {
            "type": "string"
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageAnalyticPoint"
            }
          },
          "price": {
            "$ref": "#/components/schemas/PriceResponse"
          },
          "price_id": {
            "type": "string",
            "description": "Price ID used for this usage"
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Stores property values for flexible grouping (e.g., org_id -> \"org123\")"
          },
          "reporting_unit": {
            "$ref": "#/components/schemas/types.ReportingUnit"
          },
          "source": {
            "type": "string"
          },
          "sources": {
            "type": "array",
            "description": "List of sources when not grouping by source",
            "items": {
              "type": "string"
            }
          },
          "sub_line_item_id": {
            "type": "string",
            "description": "Subscription line item ID"
          },
          "subscription_id": {
            "type": "string",
            "description": "Subscription ID"
          },
          "subscription_line_item": {
            "$ref": "#/components/schemas/subscription.SubscriptionLineItem"
          },
          "subtotal": {
            "type": "string"
          },
          "total_cost": {
            "type": "string",
            "description": "TotalCost is the final cost after discount (Subtotal - TotalDiscount)"
          },
          "total_discount": {
            "type": "string"
          },
          "total_usage": {
            "type": "string"
          },
          "total_usage_display": {
            "type": "string",
            "description": "Empty string when feature has no reporting unit; otherwise the value in reporting units"
          },
          "unit": {
            "type": "string"
          },
          "unit_plural": {
            "type": "string"
          },
          "window_size": {
            "$ref": "#/components/schemas/types.WindowSize"
          }
        }
      },
      "UsageAnalyticPoint": {
        "type": "object",
        "properties": {
          "buckets": {
            "type": "array",
            "description": "Buckets lists every commitment bucket this (possibly rolled-up) window\noverlaps \u2014 only populated when BreakdownBucket=true and the line item has\nCommitmentTimeBuckets. A coarse window can overlap more than one bucket, and\nonly partially, so this is a list. Empty when the window touches no bucket.\nIt is an informational HINT only: the point's single cost/computed_* totals\nmix all overlapped buckets and out-of-bucket time and CANNOT be split per\nbucket \u2014 read bucket_summaries for exact per-bucket cost.",
            "items": {
              "$ref": "#/components/schemas/PointBucket"
            }
          },
          "computed_commitment_utilized_amount": {
            "type": "string",
            "description": "Commitment breakdown (only populated for windowed commitments)"
          },
          "computed_overage_amount": {
            "type": "string"
          },
          "computed_true_up_amount": {
            "type": "string"
          },
          "cost": {
            "type": "string",
            "description": "Cost is the final cost after discount (Subtotal - Discount)"
          },
          "discount": {
            "type": "string"
          },
          "event_count": {
            "type": "integer",
            "description": "Number of events in this time window"
          },
          "subtotal": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "usage": {
            "type": "string"
          }
        }
      },
      "UsageBreakdownItem": {
        "type": "object",
        "properties": {
          "cost": {
            "type": "string",
            "description": "cost is the cost attributed to this group for the line item"
          },
          "event_count": {
            "type": "integer",
            "description": "event_count is the number of events from this group (optional)"
          },
          "grouped_by": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "grouped_by contains the grouping field values (e.g., {\"source\": \"api\", \"org_id\": \"org123\"})"
          },
          "percentage": {
            "type": "string",
            "description": "percentage is the percentage of total line item cost from this group (optional)"
          },
          "usage": {
            "type": "string",
            "description": "usage is the total usage amount from this group (optional, for additional context)"
          }
        }
      },
      "UsageResult": {
        "type": "object",
        "properties": {
          "value": {
            "type": "number"
          },
          "window_size": {
            "type": "string"
          }
        }
      },
      "UserResponse": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Empty for service accounts"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tenant": {
            "$ref": "#/components/schemas/TenantResponse"
          },
          "type": {
            "$ref": "#/components/schemas/types.UserType"
          }
        }
      },
      "WalletBalanceResponse": {
        "type": "object",
        "properties": {
          "alert_settings": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "alert_state": {
            "$ref": "#/components/schemas/types.AlertState"
          },
          "auto_topup": {
            "$ref": "#/components/schemas/types.AutoTopup"
          },
          "balance": {
            "type": "string"
          },
          "balance_updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "config": {
            "$ref": "#/components/schemas/types.WalletConfig"
          },
          "conversion_rate": {
            "type": "string",
            "description": "amount in the currency =  number of credits * conversion_rate\nex if conversion_rate is 1, then 1 USD = 1 credit\nex if conversion_rate is 2, then 1 USD = 0.5 credits\nex if conversion_rate is 0.5, then 1 USD = 2 credits"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "credit_balance": {
            "type": "string"
          },
          "credits_available_breakdown": {
            "$ref": "#/components/schemas/types.CreditBreakdown"
          },
          "currency": {
            "type": "string"
          },
          "current_period_usage": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "is_cached_fallback": {
            "type": "boolean",
            "description": "IsCachedFallback is true whenever the response is sourced from cache:\neither an explicit cache request, or fallback after a real-time failure.\nClients should treat the absence of this field as if it were true and\nonly trust freshness when the server explicitly emits false."
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          },
          "real_time_balance": {
            "type": "string"
          },
          "real_time_credit_balance": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "topup_conversion_rate": {
            "type": "string",
            "description": "topup_conversion_rate is the conversion rate for the topup to the currency\nex if topup_conversion_rate is 1, then 1 USD = 1 credit\nex if topup_conversion_rate is 2, then 1 USD = 0.5 credits\nex if topup_conversion_rate is 0.5, then 1 USD = 2 credits"
          },
          "unpaid_invoices_amount": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "wallet_status": {
            "$ref": "#/components/schemas/types.WalletStatus"
          },
          "wallet_type": {
            "$ref": "#/components/schemas/types.WalletType"
          }
        }
      },
      "WalletResponse": {
        "type": "object",
        "properties": {
          "alert_settings": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "alert_state": {
            "$ref": "#/components/schemas/types.AlertState"
          },
          "auto_topup": {
            "$ref": "#/components/schemas/types.AutoTopup"
          },
          "balance": {
            "type": "string"
          },
          "config": {
            "$ref": "#/components/schemas/types.WalletConfig"
          },
          "conversion_rate": {
            "type": "string",
            "description": "amount in the currency =  number of credits * conversion_rate\nex if conversion_rate is 1, then 1 USD = 1 credit\nex if conversion_rate is 2, then 1 USD = 0.5 credits\nex if conversion_rate is 0.5, then 1 USD = 2 credits"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "credit_balance": {
            "type": "string"
          },
          "credits_available_breakdown": {
            "$ref": "#/components/schemas/types.CreditBreakdown"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          },
          "real_time_balance": {
            "type": "string"
          },
          "real_time_credit_balance": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "topup_conversion_rate": {
            "type": "string",
            "description": "topup_conversion_rate is the conversion rate for the topup to the currency\nex if topup_conversion_rate is 1, then 1 USD = 1 credit\nex if topup_conversion_rate is 2, then 1 USD = 0.5 credits\nex if topup_conversion_rate is 0.5, then 1 USD = 2 credits"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "wallet_status": {
            "$ref": "#/components/schemas/types.WalletStatus"
          },
          "wallet_type": {
            "$ref": "#/components/schemas/types.WalletType"
          }
        }
      },
      "WalletTransactionResponse": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "conversion_rate": {
            "type": "string",
            "description": "conversion_rate is the conversion rate for the transaction to the currency"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "created_by_user": {
            "$ref": "#/components/schemas/UserResponse"
          },
          "credit_amount": {
            "type": "string"
          },
          "credit_balance_after": {
            "type": "string"
          },
          "credit_balance_before": {
            "type": "string"
          },
          "credits_available": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer": {
            "$ref": "#/components/schemas/CustomerResponse"
          },
          "customer_id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "expiry_date": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "idempotency_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "parent_transaction_id": {
            "type": "string",
            "description": "ParentTransactionID is the ID of the parent wallet_transaction this row was earned from\n(the purchase tx, for a bonus grant). Empty for ordinary transactions."
          },
          "priority": {
            "type": "integer"
          },
          "reference_id": {
            "type": "string"
          },
          "reference_type": {
            "$ref": "#/components/schemas/types.WalletTxReferenceType"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "topup_conversion_rate": {
            "type": "string",
            "description": "topup_conversion_rate is the conversion rate for the topup to the currency"
          },
          "transaction_reason": {
            "$ref": "#/components/schemas/types.TransactionReason"
          },
          "transaction_status": {
            "$ref": "#/components/schemas/types.TransactionStatus"
          },
          "type": {
            "$ref": "#/components/schemas/types.TransactionType"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          },
          "wallet": {
            "$ref": "#/components/schemas/WalletResponse"
          },
          "wallet_id": {
            "type": "string"
          }
        }
      },
      "WorkflowExecutionDTO": {
        "type": "object",
        "properties": {
          "close_time": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "duration_ms": {
            "type": "integer"
          },
          "entity": {
            "type": "string",
            "description": "e.g. plan, invoice, subscription"
          },
          "entity_id": {
            "type": "string",
            "description": "e.g. plan ID, invoice ID"
          },
          "run_id": {
            "type": "string"
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "task_queue": {
            "type": "string"
          },
          "total_duration": {
            "type": "string"
          },
          "workflow_id": {
            "type": "string"
          },
          "workflow_type": {
            "type": "string"
          }
        }
      },
      "errors.ErrorCode": {
        "type": "string",
        "enum": [
          "http_client_error",
          "system_error",
          "internal_error",
          "not_found",
          "already_exists",
          "version_conflict",
          "validation_error",
          "invalid_operation",
          "permission_denied",
          "database_error",
          "service_unavailable",
          "too_many_requests",
          "not_implemented"
        ],
        "x-enum-varnames": [
          "ErrCodeHTTPClient",
          "ErrCodeSystemError",
          "ErrCodeInternalError",
          "ErrCodeNotFound",
          "ErrCodeAlreadyExists",
          "ErrCodeVersionConflict",
          "ErrCodeValidation",
          "ErrCodeInvalidOperation",
          "ErrCodePermissionDenied",
          "ErrCodeDatabase",
          "ErrCodeServiceUnavailable",
          "ErrCodeTooManyRequests",
          "ErrCodeNotImplemented"
        ],
        "x-speakeasy-name-override": "ErrorCode"
      },
      "errors.ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "$ref": "#/components/schemas/errors.ErrorCode"
          },
          "http_status_code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "ErrorResponse"
      },
      "Addon": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "Coupon": {
        "type": "object",
        "properties": {
          "amount_off": {
            "type": "string"
          },
          "cadence": {
            "$ref": "#/components/schemas/types.CouponCadence"
          },
          "coupon_code": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "duration_in_periods": {
            "type": "integer"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "max_redemptions": {
            "type": "integer"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "percentage_off": {
            "type": "string"
          },
          "redeem_after": {
            "type": "string"
          },
          "redeem_before": {
            "type": "string"
          },
          "rules": {
            "type": "object",
            "additionalProperties": true
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "total_redemptions": {
            "type": "integer"
          },
          "type": {
            "$ref": "#/components/schemas/types.CouponType"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "Customer": {
        "type": "object",
        "properties": {
          "address_city": {
            "type": "string",
            "description": "AddressCity is the city of the customer's address"
          },
          "address_country": {
            "type": "string",
            "description": "AddressCountry is the country of the customer's address (ISO 3166-1 alpha-2)"
          },
          "address_line1": {
            "type": "string",
            "description": "AddressLine1 is the first line of the customer's address"
          },
          "address_line2": {
            "type": "string",
            "description": "AddressLine2 is the second line of the customer's address"
          },
          "address_postal_code": {
            "type": "string",
            "description": "AddressPostalCode is the postal code of the customer's address"
          },
          "address_state": {
            "type": "string",
            "description": "AddressState is the state of the customer's address"
          },
          "contact": {
            "type": "string",
            "description": "Contact is an optional contact number for the customer (e.g. phone)"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "description": "Email is the email of the customer"
          },
          "environment_id": {
            "type": "string",
            "description": "EnvironmentID is the environment identifier for the customer"
          },
          "external_id": {
            "type": "string",
            "description": "ExternalID is the external identifier for the customer"
          },
          "id": {
            "type": "string",
            "description": "ID is the unique identifier for the customer"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Metadata"
          },
          "name": {
            "type": "string",
            "description": "Name is the name of the customer"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "timezone": {
            "type": "string",
            "description": "Timezone is the customer's IANA timezone name (e.g. \"Asia/Kolkata\").\nDefaults to \"UTC\". Inherited by subscriptions at creation time."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "Feature": {
        "type": "object",
        "properties": {
          "alert_settings": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "group": {
            "$ref": "#/components/schemas/group.Group"
          },
          "group_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "meter_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "reporting_unit": {
            "$ref": "#/components/schemas/types.ReportingUnit"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/types.FeatureType"
          },
          "unit_plural": {
            "type": "string"
          },
          "unit_singular": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "Plan": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "display_order": {
            "type": "integer"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "types.Bucket": {
        "type": "object",
        "properties": {
          "hour": {
            "maximum": 24,
            "minimum": 0,
            "type": "integer"
          },
          "minute": {
            "maximum": 59,
            "minimum": 0,
            "type": "integer"
          }
        },
        "x-speakeasy-name-override": "Bucket"
      },
      "types.Duration": {
        "type": "object",
        "properties": {
          "unit": {
            "$ref": "#/components/schemas/types.DurationUnit"
          },
          "value": {
            "type": "integer"
          }
        },
        "enum": [
          "3600000000000"
        ],
        "x-enum-varnames": [
          "EntitlementGrantMinDuration"
        ],
        "x-speakeasy-name-override": "Duration"
      },
      "types.Value": {
        "type": "object",
        "properties": {
          "array": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "boolean": {
            "type": "boolean"
          },
          "date": {
            "type": "string"
          },
          "number": {
            "type": "number"
          },
          "string": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "Value"
      },
      "group.Group": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.GroupEntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "invoice.InvoiceLineItem": {
        "type": "object",
        "properties": {
          "adjusted_entitlement_quantity": {
            "type": "string",
            "description": "adjusted_entitlement_quantity is the entitlement-covered portion deducted from raw usage.\nNil when no entitlement was applied. Raw usage = Quantity + AdjustedEntitlementQuantity."
          },
          "amount": {
            "type": "string"
          },
          "commitment_info": {
            "$ref": "#/components/schemas/types.CommitmentInfo"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "type": "string"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invoice_id": {
            "type": "string"
          },
          "invoice_level_discount": {
            "type": "string",
            "description": "invoice_level_discount is the discount amount in invoice currency applied to all line items on the invoice."
          },
          "line_item_discount": {
            "type": "string",
            "description": "line_item_discount is the discount amount in invoice currency applied directly to this line item."
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "meter_display_name": {
            "type": "string"
          },
          "meter_id": {
            "type": "string"
          },
          "parent_line_item_id": {
            "type": "string",
            "description": "parent_line_item_id links this line item to the line item it replaced, if it was created by editing\nan existing line item. Forms a linked-list chain across edits; nil for line items that were never edited."
          },
          "period_end": {
            "type": "string",
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "format": "date-time"
          },
          "plan_display_name": {
            "type": "string"
          },
          "prepaid_credits_applied": {
            "type": "string",
            "description": "prepaid_credits_applied is the amount in invoice currency reduced from this line item due to prepaid credits application."
          },
          "price_id": {
            "type": "string"
          },
          "price_type": {
            "type": "string"
          },
          "price_unit": {
            "type": "string"
          },
          "price_unit_amount": {
            "type": "string"
          },
          "price_unit_id": {
            "type": "string"
          },
          "quantity": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string"
          },
          "subscription_line_item_id": {
            "type": "string",
            "description": "sub_line_item_id links this invoice line item to the subscription_line_item that generated it."
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "meter.Aggregation": {
        "type": "object",
        "properties": {
          "bucket_size": {
            "$ref": "#/components/schemas/types.WindowSize"
          },
          "expression": {
            "type": "string",
            "description": "Expression is an optional CEL expression to compute per-event quantity from event.properties.\nWhen set, it replaces Field-based extraction. Property names are used directly (e.g., token * duration * pixel)."
          },
          "field": {
            "type": "string",
            "description": "Field is the key in $event.properties on which the aggregation is to be applied\nFor ex if the aggregation type is sum for API usage, the field could be \"duration_ms\"\nIgnored when Expression is set."
          },
          "group_by": {
            "type": "string",
            "description": "GroupBy is the property name in event.properties to group by before aggregating.\nCurrently only supported for MAX aggregation with bucket_size.\nWhen set, aggregation is applied per unique value of this property within each bucket,\nthen the per-group results are summed to produce the bucket total."
          },
          "multiplier": {
            "type": "string",
            "description": "Multiplier is the multiplier for the aggregation\nFor ex if the aggregation type is sum_with_multiplier for API usage, the multiplier could be 1000\nto scale up by a factor of 1000. If not provided, it will be null."
          },
          "type": {
            "$ref": "#/components/schemas/types.AggregationType"
          }
        }
      },
      "meter.Filter": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Key is the key for the filter from $event.properties\nCurrently we support only first level keys in the properties and not nested keys"
          },
          "values": {
            "type": "array",
            "description": "Values are the possible values for the filter to be considered for the meter\nFor ex \"model_name\" could have values \"o1-mini\", \"gpt-4o\" etc",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "meter.Meter": {
        "type": "object",
        "properties": {
          "aggregation": {
            "$ref": "#/components/schemas/meter.Aggregation"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "environment_id": {
            "type": "string",
            "description": "EnvironmentID is the environment identifier for the meter"
          },
          "event_name": {
            "type": "string",
            "description": "EventName is the unique identifier for the event that this meter is tracking\nIt is a mandatory field in the events table and hence being used as the primary matching field\nWe can have multiple meters tracking the same event but with different filters and aggregation"
          },
          "filters": {
            "type": "array",
            "description": "Filters define the criteria for the meter to be applied on the events before aggregation\nIt also defines the possible values on which later the charges will be applied",
            "items": {
              "$ref": "#/components/schemas/meter.Filter"
            }
          },
          "id": {
            "type": "string",
            "description": "ID is the unique identifier for the meter"
          },
          "name": {
            "type": "string",
            "description": "Name is the display name of the meter"
          },
          "reset_usage": {
            "$ref": "#/components/schemas/types.ResetUsage"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "models.TemporalWorkflowResult": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "run_id": {
            "type": "string"
          },
          "workflow_id": {
            "type": "string"
          }
        }
      },
      "price.JSONBFilters": {
        "type": "object",
        "additionalProperties": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "price.JSONBMetadata": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        }
      },
      "price.JSONBTransformQuantity": {
        "type": "object",
        "properties": {
          "divide_by": {
            "type": "integer",
            "description": "Divide quantity by this number"
          },
          "round": {
            "$ref": "#/components/schemas/types.RoundType"
          }
        }
      },
      "price.Price": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount stored in main currency units (e.g., dollars, not cents)\nFor USD: 12.50 means $12.50"
          },
          "billing_cadence": {
            "$ref": "#/components/schemas/types.BillingCadence"
          },
          "billing_model": {
            "$ref": "#/components/schemas/types.BillingModel"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer",
            "description": "BillingPeriodCount is the count of the billing period ex 1, 3, 6, 12"
          },
          "conversion_rate": {
            "type": "string",
            "description": "ConversionRate is the conversion rate of the price unit to the fiat currency"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "description": "Currency 3 digit ISO currency code in lowercase ex usd, eur, gbp"
          },
          "description": {
            "type": "string",
            "description": "Description of the price"
          },
          "display_amount": {
            "type": "string",
            "description": "DisplayAmount is the formatted amount with currency symbol\nFor USD: $12.50"
          },
          "display_name": {
            "type": "string",
            "description": "DisplayName is the name of the price"
          },
          "display_price_unit_amount": {
            "type": "string",
            "description": "DisplayPriceUnitAmount is the formatted amount of the price unit"
          },
          "end_date": {
            "type": "string",
            "description": "EndDate is the end date of the price",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string",
            "description": "EntityID holds the value of the \"entity_id\" field."
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.PriceEntityType"
          },
          "environment_id": {
            "type": "string",
            "description": "EnvironmentID is the environment identifier for the price"
          },
          "group_id": {
            "type": "string",
            "description": "GroupID references the group this price belongs to"
          },
          "id": {
            "type": "string",
            "description": "ID uuid identifier for the price"
          },
          "invoice_cadence": {
            "$ref": "#/components/schemas/types.InvoiceCadence"
          },
          "lookup_key": {
            "type": "string",
            "description": "LookupKey used for looking up the price in the database"
          },
          "metadata": {
            "$ref": "#/components/schemas/price.JSONBMetadata"
          },
          "meter_id": {
            "type": "string",
            "description": "MeterID is the id of the meter for usage based pricing"
          },
          "min_quantity": {
            "type": "string",
            "description": "MinQuantity is the minimum quantity of the price",
            "nullable": true
          },
          "parent_price_id": {
            "type": "string",
            "description": "ParentPriceID references the root price (always set for price lineage tracking)"
          },
          "price_unit": {
            "type": "string",
            "description": "PriceUnit is the code of the price unit (e.g., 'btc', 'eth')"
          },
          "price_unit_amount": {
            "type": "string",
            "description": "PriceUnitAmount is the amount of the price unit"
          },
          "price_unit_id": {
            "type": "string",
            "description": "PriceUnitID is the id of the price unit (for CUSTOM type)"
          },
          "price_unit_tiers": {
            "type": "array",
            "description": "PriceUnitTiers are the tiers for the price unit when BillingModel is TIERED",
            "items": {
              "$ref": "#/components/schemas/price.PriceTier"
            }
          },
          "price_unit_type": {
            "$ref": "#/components/schemas/types.PriceUnitType"
          },
          "sequence": {
            "type": "integer",
            "description": "Sequence is the monotonic stamp bumped on every state change that\nsubscription line items need to react to. Read by the plan-price sync;\nset by the database (DEFAULT nextval) on create and by the price\nrepository on termination / compatibility-affecting edits."
          },
          "start_date": {
            "type": "string",
            "description": "StartDate is the start date of the price",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "tenant_id": {
            "type": "string"
          },
          "tier_mode": {
            "$ref": "#/components/schemas/types.BillingTier"
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/price.PriceTier"
            }
          },
          "transform_quantity": {
            "$ref": "#/components/schemas/price.JSONBTransformQuantity"
          },
          "trial_period_days": {
            "type": "integer",
            "description": "TrialPeriodDays is the number of days for the trial period\nNote: This is only applicable for recurring prices (BILLING_CADENCE_RECURRING)"
          },
          "type": {
            "$ref": "#/components/schemas/types.PriceType"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "price.PriceTier": {
        "type": "object",
        "properties": {
          "flat_amount": {
            "type": "string",
            "description": "flat_amount is the flat amount for the given tier (optional)\nApplied on top of unit_amount*quantity. Useful for cases like \"2.7$ + 5c\""
          },
          "unit_amount": {
            "type": "string",
            "description": "unit_amount is the amount per unit for the given tier"
          },
          "up_to": {
            "type": "integer",
            "description": "up_to is the quantity up to which this tier applies. It is null for the last tier.\nIMPORTANT: Tier boundaries are INCLUSIVE.\n- If up_to is 1000, then quantity less than or equal to 1000 belongs to this tier\n- This behavior is consistent across both VOLUME and SLAB tier modes"
          }
        }
      },
      "price.TransformQuantity": {
        "type": "object",
        "properties": {
          "divide_by": {
            "type": "integer",
            "description": "Divide quantity by this number"
          },
          "round": {
            "$ref": "#/components/schemas/types.RoundType"
          }
        }
      },
      "subscription.SubscriptionLineItem": {
        "type": "object",
        "properties": {
          "addon_association_id": {
            "type": "string"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer",
            "description": "from price at create; default 1"
          },
          "commitment_amount": {
            "type": "string",
            "description": "Commitment fields"
          },
          "commitment_duration": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "commitment_overage_factor": {
            "type": "string"
          },
          "commitment_quantity": {
            "type": "string"
          },
          "commitment_time_buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.TimeOfDayBucket"
            }
          },
          "commitment_true_up_enabled": {
            "type": "boolean"
          },
          "commitment_type": {
            "$ref": "#/components/schemas/types.CommitmentType"
          },
          "commitment_windowed": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.SubscriptionLineItemEntityType"
          },
          "environment_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "invoice_cadence": {
            "$ref": "#/components/schemas/types.InvoiceCadence"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "meter": {
            "$ref": "#/components/schemas/meter.Meter"
          },
          "meter_display_name": {
            "type": "string"
          },
          "meter_id": {
            "type": "string"
          },
          "plan_display_name": {
            "type": "string"
          },
          "price": {
            "$ref": "#/components/schemas/price.Price"
          },
          "price_id": {
            "type": "string"
          },
          "price_type": {
            "$ref": "#/components/schemas/types.PriceType"
          },
          "price_unit": {
            "type": "string"
          },
          "price_unit_id": {
            "type": "string"
          },
          "quantity": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string"
          },
          "subscription_phase_id": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "subscription.SubscriptionPause": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "environment_id": {
            "type": "string",
            "description": "EnvironmentID is the environment identifier for the pause"
          },
          "id": {
            "type": "string",
            "description": "ID is the unique identifier for the subscription pause"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "original_period_end": {
            "type": "string",
            "description": "OriginalPeriodEnd is the end of the billing period when the pause was created",
            "format": "date-time"
          },
          "original_period_start": {
            "type": "string",
            "description": "OriginalPeriodStart is the start of the billing period when the pause was created",
            "format": "date-time"
          },
          "pause_end": {
            "type": "string",
            "description": "PauseEnd is when the pause will end (null for indefinite)",
            "format": "date-time"
          },
          "pause_mode": {
            "$ref": "#/components/schemas/types.PauseMode"
          },
          "pause_start": {
            "type": "string",
            "description": "PauseStart is when the pause actually started",
            "format": "date-time"
          },
          "pause_status": {
            "$ref": "#/components/schemas/types.PauseStatus"
          },
          "reason": {
            "type": "string",
            "description": "Reason is the reason for pausing"
          },
          "resume_mode": {
            "$ref": "#/components/schemas/types.ResumeMode"
          },
          "resumed_at": {
            "type": "string",
            "description": "ResumedAt is when the pause was actually ended (if manually resumed)",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string",
            "description": "SubscriptionID is the identifier for the subscription"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "subscription.SubscriptionPhase": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "description": "EndDate is when the phase ends (nil if phase is still active or indefinite)",
            "format": "date-time"
          },
          "environment_id": {
            "type": "string",
            "description": "EnvironmentID is the environment identifier for the phase"
          },
          "id": {
            "type": "string",
            "description": "ID is the unique identifier for the subscription phase"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "start_date": {
            "type": "string",
            "description": "StartDate is when the phase starts",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string",
            "description": "SubscriptionID is the identifier for the subscription"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "types.AWSMarketplaceSyncConfig": {
        "type": "object",
        "properties": {
          "region": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "AWSMarketplaceSyncConfig"
      },
      "types.AddAddonParams": {
        "type": "object",
        "properties": {
          "addons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.AddAddonRef"
            }
          },
          "subscription_id": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "AddAddonParams"
      },
      "types.AddAddonRef": {
        "type": "object",
        "properties": {
          "addon_id": {
            "type": "string"
          },
          "association_id": {
            "type": "string"
          },
          "cadence": {
            "$ref": "#/components/schemas/types.AddonCadence"
          },
          "proration_behavior": {
            "$ref": "#/components/schemas/types.ProrationBehavior"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          }
        },
        "x-speakeasy-name-override": "AddAddonRef"
      },
      "types.AddonAssociationEntityType": {
        "type": "string",
        "enum": [
          "subscription",
          "plan",
          "addon"
        ],
        "x-enum-varnames": [
          "AddonAssociationEntityTypeSubscription",
          "AddonAssociationEntityTypePlan",
          "AddonAssociationEntityTypeAddon"
        ],
        "x-speakeasy-name-override": "AddonAssociationEntityType"
      },
      "types.AddonCadence": {
        "type": "string",
        "enum": [
          "onetime",
          "recurring"
        ],
        "x-enum-varnames": [
          "AddonCadenceOnetime",
          "AddonCadenceRecurring"
        ],
        "x-speakeasy-name-override": "AddonCadence"
      },
      "types.AddonFilter": {
        "type": "object",
        "properties": {
          "addon_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "expand": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "description": "filters allows complex filtering based on multiple fields",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "lookup_keys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          }
        },
        "x-speakeasy-name-override": "AddonFilter"
      },
      "types.AddonStatus": {
        "type": "string",
        "enum": [
          "active",
          "cancelled",
          "pending"
        ],
        "x-enum-varnames": [
          "AddonStatusActive",
          "AddonStatusCancelled",
          "AddonStatusPending"
        ],
        "x-speakeasy-name-override": "AddonStatus"
      },
      "types.AggregationType": {
        "type": "string",
        "enum": [
          "COUNT",
          "SUM",
          "AVG",
          "COUNT_UNIQUE",
          "LATEST",
          "SUM_WITH_MULTIPLIER",
          "MAX",
          "WEIGHTED_SUM"
        ],
        "x-enum-comments": {
          "AggregationSumWithMultiplier": "Sum with a multiplier - [sum(value) * multiplier]"
        },
        "x-enum-varnames": [
          "AggregationCount",
          "AggregationSum",
          "AggregationAvg",
          "AggregationCountUnique",
          "AggregationLatest",
          "AggregationSumWithMultiplier",
          "AggregationMax",
          "AggregationWeightedSum"
        ],
        "x-speakeasy-name-override": "AggregationType"
      },
      "types.AlertCondition": {
        "type": "string",
        "enum": [
          "above",
          "below"
        ],
        "x-enum-varnames": [
          "AlertConditionAbove",
          "AlertConditionBelow"
        ],
        "x-speakeasy-name-override": "AlertCondition"
      },
      "types.AlertEntityType": {
        "type": "string",
        "enum": [
          "wallet",
          "feature",
          "subscription",
          "subscription_line_item",
          "group",
          "entitlement_grant"
        ],
        "x-enum-varnames": [
          "AlertEntityTypeWallet",
          "AlertEntityTypeFeature",
          "AlertEntityTypeSubscription",
          "AlertEntityTypeSubscriptionLineItem",
          "AlertEntityTypeGroup",
          "AlertEntityTypeEntitlementGrant"
        ],
        "x-speakeasy-name-override": "AlertEntityType"
      },
      "types.AlertInfo": {
        "type": "object",
        "properties": {
          "alert_settings": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "timestamp": {
            "type": "string"
          },
          "value_at_time": {
            "type": "string",
            "format": "date-time"
          }
        },
        "x-speakeasy-name-override": "AlertInfo"
      },
      "types.AlertLogFilter": {
        "type": "object",
        "properties": {
          "alert_status": {
            "$ref": "#/components/schemas/types.AlertState"
          },
          "alert_type": {
            "$ref": "#/components/schemas/types.AlertType"
          },
          "customer_id": {
            "type": "string"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.AlertEntityType"
          },
          "expand": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "description": "filters allows complex filtering based on multiple fields",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          }
        },
        "x-speakeasy-name-override": "AlertLogFilter"
      },
      "types.AlertSettings": {
        "type": "object",
        "properties": {
          "alert_enabled": {
            "type": "boolean"
          },
          "critical": {
            "$ref": "#/components/schemas/types.AlertThreshold"
          },
          "info": {
            "$ref": "#/components/schemas/types.AlertThreshold"
          },
          "warning": {
            "$ref": "#/components/schemas/types.AlertThreshold"
          }
        },
        "x-speakeasy-name-override": "AlertSettings"
      },
      "types.AlertSettingsFilter": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.AlertEntityType"
          },
          "expand": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "description": "filters allows complex filtering based on multiple fields",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "parent_entity_id": {
            "type": "string"
          },
          "parent_entity_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "parent_entity_type": {
            "$ref": "#/components/schemas/types.AlertEntityType"
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          }
        },
        "x-speakeasy-name-override": "AlertSettingsFilter"
      },
      "types.AlertState": {
        "type": "string",
        "enum": [
          "ok",
          "info",
          "warning",
          "in_alarm"
        ],
        "x-enum-varnames": [
          "AlertStateOk",
          "AlertStateInfo",
          "AlertStateWarning",
          "AlertStateInAlarm"
        ],
        "x-speakeasy-name-override": "AlertState"
      },
      "types.AlertThreshold": {
        "type": "object",
        "properties": {
          "condition": {
            "$ref": "#/components/schemas/types.AlertCondition"
          },
          "threshold": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "AlertThreshold"
      },
      "types.AlertType": {
        "type": "string",
        "enum": [
          "low_ongoing_balance",
          "low_credit_balance",
          "feature_wallet_balance",
          "subscription_spend",
          "subscription_line_item_spend",
          "subscription_group_spend",
          "entitlement_grant_threshold",
          "entitlement_grant_exhausted"
        ],
        "x-enum-varnames": [
          "AlertTypeLowOngoingBalance",
          "AlertTypeLowCreditBalance",
          "AlertTypeFeatureWalletBalance",
          "AlertTypeSubscriptionSpend",
          "AlertTypeSubscriptionLineItemSpend",
          "AlertTypeSubscriptionGroupSpend",
          "AlertTypeEntitlementGrantThreshold",
          "AlertTypeEntitlementGrantExhausted"
        ],
        "x-speakeasy-name-override": "AlertType"
      },
      "types.ApplicationStatus": {
        "type": "string",
        "enum": [
          "applied",
          "failed",
          "pending",
          "skipped",
          "cancelled"
        ],
        "x-enum-varnames": [
          "ApplicationStatusApplied",
          "ApplicationStatusFailed",
          "ApplicationStatusPending",
          "ApplicationStatusSkipped",
          "ApplicationStatusCancelled"
        ],
        "x-speakeasy-name-override": "ApplicationStatus"
      },
      "types.AutoTopup": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number"
          },
          "cooldown": {
            "$ref": "#/components/schemas/types.Duration"
          },
          "enabled": {
            "type": "boolean"
          },
          "invoicing": {
            "type": "boolean"
          },
          "threshold": {
            "type": "number"
          }
        },
        "x-speakeasy-name-override": "AutoTopup"
      },
      "types.BillingCadence": {
        "type": "string",
        "enum": [
          "RECURRING"
        ],
        "x-enum-varnames": [
          "BILLING_CADENCE_RECURRING"
        ],
        "x-speakeasy-name-override": "BillingCadence"
      },
      "types.BillingCycle": {
        "type": "string",
        "enum": [
          "anniversary",
          "calendar"
        ],
        "x-enum-varnames": [
          "BillingCycleAnniversary",
          "BillingCycleCalendar"
        ],
        "x-speakeasy-name-override": "BillingCycle"
      },
      "types.BillingModel": {
        "type": "string",
        "enum": [
          "FLAT_FEE",
          "PACKAGE",
          "TIERED"
        ],
        "x-enum-varnames": [
          "BILLING_MODEL_FLAT_FEE",
          "BILLING_MODEL_PACKAGE",
          "BILLING_MODEL_TIERED"
        ],
        "x-speakeasy-name-override": "BillingModel"
      },
      "types.BillingPeriod": {
        "type": "string",
        "enum": [
          "MONTHLY",
          "ANNUAL",
          "WEEKLY",
          "DAILY",
          "QUARTERLY",
          "HALF_YEARLY",
          "ONETIME"
        ],
        "x-enum-varnames": [
          "BILLING_PERIOD_MONTHLY",
          "BILLING_PERIOD_ANNUAL",
          "BILLING_PERIOD_WEEKLY",
          "BILLING_PERIOD_DAILY",
          "BILLING_PERIOD_QUARTER",
          "BILLING_PERIOD_HALF_YEAR",
          "BILLING_PERIOD_ONETIME"
        ],
        "x-speakeasy-name-override": "BillingPeriod"
      },
      "types.BillingTier": {
        "type": "string",
        "enum": [
          "VOLUME",
          "SLAB"
        ],
        "x-enum-varnames": [
          "BILLING_TIER_VOLUME",
          "BILLING_TIER_SLAB"
        ],
        "x-speakeasy-name-override": "BillingTier"
      },
      "types.CancelImmediatelyInvoicePolicy": {
        "type": "string",
        "enum": [
          "generate_invoice",
          "skip"
        ],
        "x-enum-varnames": [
          "CancelImmediatelyInvoicePolicyGenerateInvoice",
          "CancelImmediatelyInvoicePolicySkip"
        ],
        "x-speakeasy-name-override": "CancelImmediatelyInvoicePolicy"
      },
      "types.CancellationType": {
        "type": "string",
        "enum": [
          "immediate",
          "end_of_period",
          "scheduled_date"
        ],
        "x-enum-varnames": [
          "CancellationTypeImmediate",
          "CancellationTypeEndOfPeriod",
          "CancellationTypeScheduledDate"
        ],
        "x-speakeasy-name-override": "CancellationType"
      },
      "types.CheckoutAction": {
        "type": "string",
        "enum": [
          "create_subscription",
          "modify_subscription",
          "wallet_topup",
          "add_addon"
        ],
        "x-enum-varnames": [
          "CheckoutActionCreateSubscription",
          "CheckoutActionModifySubscription",
          "CheckoutActionWalletTopup",
          "CheckoutActionAddAddon"
        ],
        "x-speakeasy-name-override": "CheckoutAction"
      },
      "types.CheckoutConfiguration": {
        "type": "object",
        "properties": {
          "add_addon_params": {
            "$ref": "#/components/schemas/types.AddAddonParams"
          },
          "create_subscription_params": {
            "$ref": "#/components/schemas/types.CreateSubscriptionParams"
          },
          "modify_subscription_params": {
            "$ref": "#/components/schemas/types.ModifySubscriptionParams"
          },
          "wallet_topup_params": {
            "$ref": "#/components/schemas/types.WalletTopupParams"
          }
        },
        "x-speakeasy-name-override": "CheckoutConfiguration"
      },
      "types.CheckoutPaymentProvider": {
        "type": "string",
        "enum": [
          "razorpay"
        ],
        "x-enum-varnames": [
          "CheckoutPaymentProviderRazorpay"
        ],
        "x-speakeasy-name-override": "CheckoutPaymentProvider"
      },
      "types.CheckoutPaymentProviderConfig": {
        "type": "object",
        "properties": {
          "collection_method": {
            "$ref": "#/components/schemas/types.CollectionMethod"
          },
          "max_mandate_limit": {
            "type": "string"
          },
          "payment_method": {
            "$ref": "#/components/schemas/types.PaymentMethodType"
          }
        },
        "x-speakeasy-name-override": "CheckoutPaymentProviderConfig"
      },
      "types.CheckoutStatus": {
        "type": "string",
        "enum": [
          "initiated",
          "pending",
          "completed",
          "failed",
          "expired"
        ],
        "x-enum-varnames": [
          "CheckoutStatusInitiated",
          "CheckoutStatusPending",
          "CheckoutStatusCompleted",
          "CheckoutStatusFailed",
          "CheckoutStatusExpired"
        ],
        "x-speakeasy-name-override": "CheckoutStatus"
      },
      "types.CollectionMethod": {
        "type": "string",
        "enum": [
          "charge_automatically",
          "send_invoice"
        ],
        "x-enum-varnames": [
          "CollectionMethodChargeAutomatically",
          "CollectionMethodSendInvoice"
        ],
        "x-speakeasy-name-override": "CollectionMethod"
      },
      "types.CommitmentInfo": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "computed_commitment_utilized_amount": {
            "type": "string"
          },
          "computed_overage_amount": {
            "type": "string"
          },
          "computed_true_up_amount": {
            "type": "string",
            "description": "total_cost = computed_commitment_utilized_amount + computed_overage_amount + computed_true_up_amount"
          },
          "duration": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "is_windowed": {
            "type": "boolean"
          },
          "overage_factor": {
            "type": "string"
          },
          "quantity": {
            "type": "string",
            "description": "Only used for quantity-based commitments"
          },
          "true_up_enabled": {
            "type": "boolean"
          },
          "type": {
            "$ref": "#/components/schemas/types.CommitmentType"
          }
        },
        "x-speakeasy-name-override": "CommitmentInfo"
      },
      "types.CommitmentType": {
        "type": "string",
        "enum": [
          "amount",
          "quantity"
        ],
        "x-enum-varnames": [
          "COMMITMENT_TYPE_AMOUNT",
          "COMMITMENT_TYPE_QUANTITY"
        ],
        "x-speakeasy-name-override": "CommitmentType"
      },
      "types.CouponCadence": {
        "type": "string",
        "enum": [
          "once",
          "repeated",
          "forever"
        ],
        "x-enum-varnames": [
          "CouponCadenceOnce",
          "CouponCadenceRepeated",
          "CouponCadenceForever"
        ],
        "x-speakeasy-name-override": "CouponCadence"
      },
      "types.CouponFilter": {
        "type": "object",
        "properties": {
          "coupon_codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "coupon_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expand": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          }
        },
        "x-speakeasy-name-override": "CouponFilter"
      },
      "types.CouponType": {
        "type": "string",
        "enum": [
          "fixed",
          "percentage"
        ],
        "x-enum-varnames": [
          "CouponTypeFixed",
          "CouponTypePercentage"
        ],
        "x-speakeasy-name-override": "CouponType"
      },
      "types.CreateSubscriptionParams": {
        "type": "object",
        "properties": {
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "currency": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "plan_id": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "subscription_id": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "CreateSubscriptionParams"
      },
      "types.CreateSubscriptionResult": {
        "type": "object",
        "properties": {
          "invoice_id": {
            "type": "string"
          },
          "payment_id": {
            "type": "string"
          },
          "subscription_id": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "CreateSubscriptionResult"
      },
      "types.CreditBreakdown": {
        "type": "object",
        "properties": {
          "free": {
            "type": "string"
          },
          "purchased": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "CreditBreakdown"
      },
      "types.CreditGrantApplicationReason": {
        "type": "string",
        "enum": [
          "first_time_recurring_credit_grant",
          "recurring_credit_grant",
          "onetime_credit_grant"
        ],
        "x-enum-varnames": [
          "ApplicationReasonFirstTimeRecurringCreditGrant",
          "ApplicationReasonRecurringCreditGrant",
          "ApplicationReasonOnetimeCreditGrant"
        ],
        "x-speakeasy-name-override": "CreditGrantApplicationReason"
      },
      "types.CreditGrantCadence": {
        "type": "string",
        "enum": [
          "ONETIME",
          "RECURRING"
        ],
        "x-enum-varnames": [
          "CreditGrantCadenceOneTime",
          "CreditGrantCadenceRecurring"
        ],
        "x-speakeasy-name-override": "CreditGrantCadence"
      },
      "types.CreditGrantExpiryDurationUnit": {
        "type": "string",
        "enum": [
          "DAY",
          "WEEK",
          "MONTH",
          "YEAR"
        ],
        "x-enum-varnames": [
          "CreditGrantExpiryDurationUnitDays",
          "CreditGrantExpiryDurationUnitWeeks",
          "CreditGrantExpiryDurationUnitMonths",
          "CreditGrantExpiryDurationUnitYears"
        ],
        "x-speakeasy-name-override": "CreditGrantExpiryDurationUnit"
      },
      "types.CreditGrantExpiryType": {
        "type": "string",
        "enum": [
          "NEVER",
          "DURATION",
          "BILLING_CYCLE"
        ],
        "x-enum-varnames": [
          "CreditGrantExpiryTypeNever",
          "CreditGrantExpiryTypeDuration",
          "CreditGrantExpiryTypeBillingCycle"
        ],
        "x-speakeasy-name-override": "CreditGrantExpiryType"
      },
      "types.CreditGrantPeriod": {
        "type": "string",
        "enum": [
          "DAILY",
          "WEEKLY",
          "MONTHLY",
          "ANNUAL",
          "QUARTERLY",
          "HALF_YEARLY"
        ],
        "x-enum-varnames": [
          "CREDIT_GRANT_PERIOD_DAILY",
          "CREDIT_GRANT_PERIOD_WEEKLY",
          "CREDIT_GRANT_PERIOD_MONTHLY",
          "CREDIT_GRANT_PERIOD_ANNUAL",
          "CREDIT_GRANT_PERIOD_QUARTER",
          "CREDIT_GRANT_PERIOD_HALF_YEARLY"
        ],
        "x-speakeasy-name-override": "CreditGrantPeriod"
      },
      "types.CreditGrantScope": {
        "type": "string",
        "enum": [
          "PLAN",
          "SUBSCRIPTION",
          "ADDON"
        ],
        "x-enum-varnames": [
          "CreditGrantScopePlan",
          "CreditGrantScopeSubscription",
          "CreditGrantScopeAddon"
        ],
        "x-speakeasy-name-override": "CreditGrantScope"
      },
      "types.CreditNoteReason": {
        "type": "string",
        "enum": [
          "DUPLICATE",
          "FRAUDULENT",
          "ORDER_CHANGE",
          "UNSATISFACTORY",
          "SERVICE_ISSUE",
          "BILLING_ERROR",
          "SUBSCRIPTION_CANCELLATION"
        ],
        "x-enum-varnames": [
          "CreditNoteReasonDuplicate",
          "CreditNoteReasonFraudulent",
          "CreditNoteReasonOrderChange",
          "CreditNoteReasonUnsatisfactory",
          "CreditNoteReasonService",
          "CreditNoteReasonBillingError",
          "CreditNoteReasonSubscriptionCancellation"
        ],
        "x-speakeasy-name-override": "CreditNoteReason"
      },
      "types.CreditNoteStatus": {
        "type": "string",
        "enum": [
          "DRAFT",
          "FINALIZED",
          "VOIDED"
        ],
        "x-enum-varnames": [
          "CreditNoteStatusDraft",
          "CreditNoteStatusFinalized",
          "CreditNoteStatusVoided"
        ],
        "x-speakeasy-name-override": "CreditNoteStatus"
      },
      "types.CreditNoteType": {
        "type": "string",
        "enum": [
          "ADJUSTMENT",
          "REFUND"
        ],
        "x-enum-varnames": [
          "CreditNoteTypeAdjustment",
          "CreditNoteTypeRefund"
        ],
        "x-speakeasy-name-override": "CreditNoteType"
      },
      "types.CustomerFilter": {
        "type": "object",
        "properties": {
          "customer_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "email": {
            "type": "string"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "expand": {
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "external_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          }
        },
        "x-speakeasy-name-override": "CustomerFilter"
      },
      "types.DataType": {
        "type": "string",
        "enum": [
          "string",
          "number",
          "date",
          "array"
        ],
        "x-enum-varnames": [
          "DataTypeString",
          "DataTypeNumber",
          "DataTypeDate",
          "DataTypeArray"
        ],
        "x-speakeasy-name-override": "DataType"
      },
      "types.DebugTrackerStatus": {
        "type": "string",
        "enum": [
          "unprocessed",
          "not_found",
          "found",
          "error",
          "processing",
          "attributed"
        ],
        "x-enum-varnames": [
          "DebugTrackerStatusUnprocessed",
          "DebugTrackerStatusNotFound",
          "DebugTrackerStatusFound",
          "DebugTrackerStatusError",
          "DebugTrackerStatusProcessing",
          "DebugTrackerStatusAttributed"
        ],
        "x-speakeasy-name-override": "DebugTrackerStatus"
      },
      "types.DurationUnit": {
        "type": "string",
        "enum": [
          "second",
          "minute",
          "hour",
          "day"
        ],
        "x-enum-varnames": [
          "DurationUnitSecond",
          "DurationUnitMinute",
          "DurationUnitHour",
          "DurationUnitDay"
        ],
        "x-speakeasy-name-override": "DurationUnit"
      },
      "types.EntitlementAggregationMode": {
        "type": "string",
        "enum": [
          "additive",
          "parallel"
        ],
        "x-enum-varnames": [
          "EntitlementAggregationModeAdditive",
          "EntitlementAggregationModeParallel"
        ],
        "x-speakeasy-name-override": "EntitlementAggregationMode"
      },
      "types.EntitlementEntityType": {
        "type": "string",
        "enum": [
          "PLAN",
          "SUBSCRIPTION",
          "ADDON"
        ],
        "x-enum-varnames": [
          "ENTITLEMENT_ENTITY_TYPE_PLAN",
          "ENTITLEMENT_ENTITY_TYPE_SUBSCRIPTION",
          "ENTITLEMENT_ENTITY_TYPE_ADDON"
        ],
        "x-speakeasy-name-override": "EntitlementEntityType"
      },
      "types.EntitlementFilter": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "entity_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.EntitlementEntityType"
          },
          "expand": {
            "type": "string"
          },
          "feature_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "feature_type": {
            "$ref": "#/components/schemas/types.FeatureType"
          },
          "filters": {
            "type": "array",
            "description": "Specific filters for entitlements",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "has_grant_config": {
            "type": "boolean",
            "description": "HasGrantConfig filters on grant-config presence (grant_quota set or not)."
          },
          "is_enabled": {
            "type": "boolean"
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "plan_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          }
        },
        "x-speakeasy-name-override": "EntitlementFilter"
      },
      "types.EntitlementGrantDurationUnit": {
        "type": "string",
        "enum": [
          "hour",
          "day",
          "week"
        ],
        "x-enum-varnames": [
          "EntitlementGrantDurationUnitHour",
          "EntitlementGrantDurationUnitDay",
          "EntitlementGrantDurationUnitWeek"
        ],
        "x-speakeasy-name-override": "EntitlementGrantDurationUnit"
      },
      "types.EntitlementGrantMeasure": {
        "type": "string",
        "enum": [
          "quantity",
          "amount"
        ],
        "x-enum-varnames": [
          "EntitlementGrantMeasureQuantity",
          "EntitlementGrantMeasureAmount"
        ],
        "x-speakeasy-name-override": "EntitlementGrantMeasure"
      },
      "types.EntitlementUsageResetPeriod": {
        "type": "string",
        "enum": [
          "MONTHLY",
          "ANNUAL",
          "WEEKLY",
          "DAILY",
          "QUARTERLY",
          "HALF_YEARLY",
          "NEVER"
        ],
        "x-enum-varnames": [
          "ENTITLEMENT_USAGE_RESET_PERIOD_MONTHLY",
          "ENTITLEMENT_USAGE_RESET_PERIOD_ANNUAL",
          "ENTITLEMENT_USAGE_RESET_PERIOD_WEEKLY",
          "ENTITLEMENT_USAGE_RESET_PERIOD_DAILY",
          "ENTITLEMENT_USAGE_RESET_PERIOD_QUARTER",
          "ENTITLEMENT_USAGE_RESET_PERIOD_HALF_YEAR",
          "ENTITLEMENT_USAGE_RESET_PERIOD_NEVER"
        ],
        "x-speakeasy-name-override": "EntitlementUsageResetPeriod"
      },
      "types.EntityChangeBehaviour": {
        "type": "string",
        "enum": [
          "carry",
          "drop"
        ],
        "x-enum-varnames": [
          "EntityChangeBehaviourCarry",
          "EntityChangeBehaviourDrop"
        ],
        "x-speakeasy-name-override": "EntityChangeBehaviour"
      },
      "types.EntitySyncConfig": {
        "type": "object",
        "properties": {
          "inbound": {
            "type": "boolean",
            "description": "Inbound from external provider to FlexPrice"
          },
          "outbound": {
            "type": "boolean",
            "description": "Outbound from FlexPrice to external provider"
          }
        },
        "x-speakeasy-name-override": "EntitySyncConfig"
      },
      "types.EntityType": {
        "type": "string",
        "enum": [
          "EVENTS",
          "PRICES",
          "CUSTOMERS",
          "FEATURES"
        ],
        "x-enum-varnames": [
          "EntityTypeEvents",
          "EntityTypePrices",
          "EntityTypeCustomers",
          "EntityTypeFeatures"
        ],
        "x-speakeasy-name-override": "EntityType"
      },
      "types.EnvironmentType": {
        "type": "string",
        "enum": [
          "development",
          "production"
        ],
        "x-enum-varnames": [
          "EnvironmentDevelopment",
          "EnvironmentProduction"
        ],
        "x-speakeasy-name-override": "EnvironmentType"
      },
      "types.EventProcessingStatusType": {
        "type": "string",
        "enum": [
          "processed",
          "processing",
          "failed"
        ],
        "x-enum-varnames": [
          "EventProcessingStatusTypeProcessed",
          "EventProcessingStatusTypeProcessing",
          "EventProcessingStatusTypeFailed"
        ],
        "x-speakeasy-name-override": "EventProcessingStatusType"
      },
      "types.ExportMetadataEntityType": {
        "type": "string",
        "enum": [
          "customer",
          "wallet"
        ],
        "x-enum-varnames": [
          "ExportMetadataEntityTypeCustomer",
          "ExportMetadataEntityTypeWallet"
        ],
        "x-speakeasy-name-override": "ExportMetadataEntityType"
      },
      "types.ExportMetadataField": {
        "required": [
          "entity_type",
          "field_key"
        ],
        "type": "object",
        "properties": {
          "column_name": {
            "type": "string",
            "description": "CSV column header to be shown in the exported file"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.ExportMetadataEntityType"
          },
          "field_key": {
            "type": "string",
            "description": "metadata key to look up"
          }
        },
        "x-speakeasy-name-override": "ExportMetadataField"
      },
      "types.FailurePoint": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/errors.ErrorResponse"
          },
          "failure_point_type": {
            "$ref": "#/components/schemas/types.FailurePointType"
          }
        },
        "x-speakeasy-name-override": "FailurePoint"
      },
      "types.FailurePointType": {
        "type": "string",
        "enum": [
          "customer_lookup",
          "meter_lookup",
          "price_lookup",
          "subscription_line_item_lookup",
          "attributed_to_customer"
        ],
        "x-enum-varnames": [
          "FailurePointTypeCustomerLookup",
          "FailurePointTypeMeterLookup",
          "FailurePointTypePriceLookup",
          "FailurePointTypeSubscriptionLineItemLookup",
          "FailurePointTypeAttributedToCustomer"
        ],
        "x-speakeasy-name-override": "FailurePointType"
      },
      "types.FeatureFilter": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "expand": {
            "type": "string"
          },
          "feature_ids": {
            "type": "array",
            "description": "Feature specific filters",
            "items": {
              "type": "string"
            }
          },
          "filters": {
            "type": "array",
            "description": "filters allows complex filtering based on multiple fields",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "lookup_key": {
            "type": "string"
          },
          "lookup_keys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "meter_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "name_contains": {
            "type": "string"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          }
        },
        "x-speakeasy-name-override": "FeatureFilter"
      },
      "types.FeatureType": {
        "type": "string",
        "enum": [
          "metered",
          "boolean",
          "static",
          "config"
        ],
        "x-enum-varnames": [
          "FeatureTypeMetered",
          "FeatureTypeBoolean",
          "FeatureTypeStatic",
          "FeatureTypeConfig"
        ],
        "x-speakeasy-name-override": "FeatureType"
      },
      "types.FileType": {
        "type": "string",
        "enum": [
          "CSV",
          "JSON"
        ],
        "x-enum-varnames": [
          "FileTypeCSV",
          "FileTypeJSON"
        ],
        "x-speakeasy-name-override": "FileType"
      },
      "types.FilterCondition": {
        "type": "object",
        "properties": {
          "data_type": {
            "$ref": "#/components/schemas/types.DataType"
          },
          "field": {
            "type": "string"
          },
          "operator": {
            "$ref": "#/components/schemas/types.FilterOperatorType"
          },
          "value": {
            "$ref": "#/components/schemas/types.Value"
          }
        },
        "x-speakeasy-name-override": "FilterCondition"
      },
      "types.FilterOperatorType": {
        "type": "string",
        "enum": [
          "eq",
          "contains",
          "not_contains",
          "gt",
          "lt",
          "gte",
          "in",
          "not_in",
          "before",
          "after"
        ],
        "x-enum-varnames": [
          "EQUAL",
          "CONTAINS",
          "NOT_CONTAINS",
          "GREATER_THAN",
          "LESS_THAN",
          "GREATER_THAN_EQUAL",
          "IN",
          "NOT_IN",
          "BEFORE",
          "AFTER"
        ],
        "x-speakeasy-name-override": "FilterOperatorType"
      },
      "types.GroupEntityType": {
        "type": "string",
        "enum": [
          "price",
          "feature"
        ],
        "x-enum-varnames": [
          "GroupEntityTypePrice",
          "GroupEntityTypeFeature"
        ],
        "x-speakeasy-name-override": "GroupEntityType"
      },
      "types.GroupFilter": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "entity_type": {
            "type": "string"
          },
          "expand": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "description": "filters allows complex filtering based on multiple fields",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "group_ids": {
            "type": "array",
            "description": "Group specific filters",
            "items": {
              "type": "string"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "lookup_key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          }
        },
        "x-speakeasy-name-override": "GroupFilter"
      },
      "types.IntegrationEntityType": {
        "type": "string",
        "enum": [
          "customer",
          "plan",
          "invoice",
          "subscription",
          "payment",
          "credit_note",
          "addon",
          "item",
          "item_price",
          "price",
          "invoice_line_item"
        ],
        "x-enum-varnames": [
          "IntegrationEntityTypeCustomer",
          "IntegrationEntityTypePlan",
          "IntegrationEntityTypeInvoice",
          "IntegrationEntityTypeSubscription",
          "IntegrationEntityTypePayment",
          "IntegrationEntityTypeCreditNote",
          "IntegrationEntityTypeAddon",
          "IntegrationEntityTypeItem",
          "IntegrationEntityTypeItemPrice",
          "IntegrationEntityTypePrice",
          "IntegrationEntityTypeInvoiceLineItem"
        ],
        "x-speakeasy-name-override": "IntegrationEntityType"
      },
      "types.InvoiceBillingReason": {
        "type": "string",
        "enum": [
          "SUBSCRIPTION_CREATE",
          "SUBSCRIPTION_CYCLE",
          "SUBSCRIPTION_UPDATE",
          "SUBSCRIPTION_TRIAL_END",
          "SUBSCRIPTION_TRIAL_START",
          "PRORATION",
          "MANUAL",
          "AUTO_INVOICE_THRESHOLD",
          "WALLET_AUTO_TOPUP"
        ],
        "x-enum-varnames": [
          "InvoiceBillingReasonSubscriptionCreate",
          "InvoiceBillingReasonSubscriptionCycle",
          "InvoiceBillingReasonSubscriptionUpdate",
          "InvoiceBillingReasonSubscriptionTrialEnd",
          "InvoiceBillingReasonSubscriptionTrialStart",
          "InvoiceBillingReasonProration",
          "InvoiceBillingReasonManual",
          "InvoiceBillingReasonAutoInvoiceThreshold",
          "InvoiceBillingReasonWalletAutoTopup"
        ],
        "x-speakeasy-name-override": "InvoiceBillingReason"
      },
      "types.InvoiceCadence": {
        "type": "string",
        "enum": [
          "ARREAR",
          "ADVANCE"
        ],
        "x-enum-varnames": [
          "InvoiceCadenceArrear",
          "InvoiceCadenceAdvance"
        ],
        "x-speakeasy-name-override": "InvoiceCadence"
      },
      "types.InvoiceFilter": {
        "type": "object",
        "properties": {
          "amount_due_gt": {
            "type": "number",
            "description": "amount_due_gt filters invoices with a total amount due greater than the specified value\nUseful for finding invoices above a certain threshold or identifying high-value invoices"
          },
          "amount_remaining_gt": {
            "type": "number",
            "description": "amount_remaining_gt filters invoices with an outstanding balance greater than the specified value\nUseful for finding invoices that still have significant unpaid amounts"
          },
          "billing_reason": {
            "$ref": "#/components/schemas/types.InvoiceBillingReason"
          },
          "currency": {
            "type": "string",
            "description": "currency filters invoices by their currency (ISO 4217 code, e.g. \"usd\", \"eur\").\nMatches on the invoices.currency column exactly."
          },
          "customer_id": {
            "type": "string",
            "description": "customer_id filters invoices for a specific customer using FlexPrice's internal customer ID\nThis is the ID returned by FlexPrice when creating or retrieving customers"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "expand": {
            "type": "string"
          },
          "external_customer_id": {
            "type": "string",
            "description": "external_customer_id filters invoices for a customer using your system's customer identifier\nThis is the ID you provided when creating the customer in FlexPrice"
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "invoice_ids": {
            "type": "array",
            "description": "invoice_ids restricts results to invoices with the specified IDs\nUse this to retrieve specific invoices when you know their exact identifiers",
            "items": {
              "type": "string"
            }
          },
          "invoice_status": {
            "type": "array",
            "description": "invoice_status filters by the current state of invoices in their lifecycle\nMultiple statuses can be specified to include invoices in any of the listed states",
            "items": {
              "$ref": "#/components/schemas/types.InvoiceStatus"
            }
          },
          "invoice_type": {
            "$ref": "#/components/schemas/types.InvoiceType"
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "payment_status": {
            "type": "array",
            "description": "payment_status filters by the payment state of invoices\nMultiple statuses can be specified to include invoices with any of the listed payment states",
            "items": {
              "$ref": "#/components/schemas/types.PaymentStatus"
            }
          },
          "period_end_gte": {
            "type": "string",
            "description": "period_end_gte filters invoices with period_end >= value"
          },
          "period_end_lte": {
            "type": "string",
            "description": "period_end_lte filters invoices with period_end <= value"
          },
          "period_start_gte": {
            "type": "string",
            "description": "period_start_gte filters invoices with period_start >= value"
          },
          "period_start_lte": {
            "type": "string",
            "description": "period_start_lte filters invoices with period_start <= value"
          },
          "skip_line_items": {
            "type": "boolean",
            "description": "SkipLineItems if true, will not include line items in the response"
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_customer_id": {
            "type": "array",
            "description": "subscription_customer_id filters invoices by the subscription owner's customer ID",
            "items": {
              "type": "string"
            }
          },
          "subscription_id": {
            "type": "string",
            "description": "subscription_id filters invoices generated for a specific subscription\nOnly returns invoices that were created as part of the specified subscription's billing"
          }
        },
        "x-speakeasy-name-override": "InvoiceFilter"
      },
      "types.InvoiceStatus": {
        "type": "string",
        "enum": [
          "DRAFT",
          "FINALIZED",
          "VOIDED",
          "SKIPPED"
        ],
        "x-enum-varnames": [
          "InvoiceStatusDraft",
          "InvoiceStatusFinalized",
          "InvoiceStatusVoided",
          "InvoiceStatusSkipped"
        ],
        "x-speakeasy-name-override": "InvoiceStatus"
      },
      "types.InvoiceSyncSettings": {
        "type": "object",
        "properties": {
          "normalize_fixed_to": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          }
        },
        "x-speakeasy-name-override": "InvoiceSyncSettings"
      },
      "types.InvoiceType": {
        "type": "string",
        "enum": [
          "SUBSCRIPTION",
          "ONE_OFF",
          "CREDIT"
        ],
        "x-enum-varnames": [
          "InvoiceTypeSubscription",
          "InvoiceTypeOneOff",
          "InvoiceTypeCredit"
        ],
        "x-speakeasy-name-override": "InvoiceType"
      },
      "types.ListResponse-dto_WalletResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WalletResponse"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/types.PaginationResponse"
          }
        },
        "x-speakeasy-name-override": "ListResponse-dto_WalletResponse"
      },
      "types.Metadata": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        },
        "x-speakeasy-name-override": "Metadata"
      },
      "types.ModifySubscriptionLineItem": {
        "type": "object",
        "properties": {
          "effective_date": {
            "type": "string",
            "format": "date-time"
          },
          "line_item_id": {
            "type": "string"
          },
          "quantity": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "ModifySubscriptionLineItem"
      },
      "types.ModifySubscriptionParams": {
        "type": "object",
        "properties": {
          "line_item_modifications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.ModifySubscriptionLineItem"
            }
          },
          "subscription_id": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "ModifySubscriptionParams"
      },
      "types.PaginationResponse": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "x-speakeasy-name-override": "PaginationResponse"
      },
      "types.PauseMode": {
        "type": "string",
        "enum": [
          "immediate",
          "scheduled",
          "period_end"
        ],
        "x-enum-varnames": [
          "PauseModeImmediate",
          "PauseModeScheduled",
          "PauseModePeriodEnd"
        ],
        "x-speakeasy-name-override": "PauseMode"
      },
      "types.PauseStatus": {
        "type": "string",
        "enum": [
          "none",
          "active",
          "scheduled",
          "completed",
          "cancelled"
        ],
        "x-enum-varnames": [
          "PauseStatusNone",
          "PauseStatusActive",
          "PauseStatusScheduled",
          "PauseStatusCompleted",
          "PauseStatusCancelled"
        ],
        "x-speakeasy-name-override": "PauseStatus"
      },
      "types.PaymentAction": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/types.PaymentActionType"
          },
          "url": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "PaymentAction"
      },
      "types.PaymentActionType": {
        "type": "string",
        "enum": [
          "checkout_url",
          "payment_link"
        ],
        "x-enum-varnames": [
          "PaymentActionTypeCheckoutURL",
          "PaymentActionTypePaymentLink"
        ],
        "x-speakeasy-name-override": "PaymentActionType"
      },
      "types.PaymentBehavior": {
        "type": "string",
        "enum": [
          "allow_incomplete",
          "default_incomplete",
          "error_if_incomplete",
          "default_active"
        ],
        "x-enum-varnames": [
          "PaymentBehaviorAllowIncomplete",
          "PaymentBehaviorDefaultIncomplete",
          "PaymentBehaviorErrorIfIncomplete",
          "PaymentBehaviorDefaultActive"
        ],
        "x-speakeasy-name-override": "PaymentBehavior"
      },
      "types.PaymentDestinationType": {
        "type": "string",
        "enum": [
          "INVOICE",
          "CUSTOMER"
        ],
        "x-enum-varnames": [
          "PaymentDestinationTypeInvoice",
          "PaymentDestinationTypeCustomer"
        ],
        "x-speakeasy-name-override": "PaymentDestinationType"
      },
      "types.PaymentGatewayType": {
        "type": "string",
        "enum": [
          "stripe",
          "razorpay",
          "nomod",
          "moyasar",
          "paddle",
          "whop"
        ],
        "x-enum-varnames": [
          "PaymentGatewayTypeStripe",
          "PaymentGatewayTypeRazorpay",
          "PaymentGatewayTypeNomod",
          "PaymentGatewayTypeMoyasar",
          "PaymentGatewayTypePaddle",
          "PaymentGatewayTypeWhop"
        ],
        "x-speakeasy-name-override": "PaymentGatewayType"
      },
      "types.PaymentMethodType": {
        "type": "string",
        "enum": [
          "CARD",
          "ACH",
          "OFFLINE",
          "CREDITS",
          "PAYMENT_LINK",
          "UPI"
        ],
        "x-enum-varnames": [
          "PaymentMethodTypeCard",
          "PaymentMethodTypeACH",
          "PaymentMethodTypeOffline",
          "PaymentMethodTypeCredits",
          "PaymentMethodTypePaymentLink",
          "PaymentMethodTypeUPI"
        ],
        "x-speakeasy-name-override": "PaymentMethodType"
      },
      "types.PaymentStatus": {
        "type": "string",
        "enum": [
          "INITIATED",
          "PENDING",
          "PROCESSING",
          "SUCCEEDED",
          "OVERPAID",
          "FAILED",
          "REFUNDED",
          "PARTIALLY_REFUNDED",
          "VOIDED"
        ],
        "x-enum-varnames": [
          "PaymentStatusInitiated",
          "PaymentStatusPending",
          "PaymentStatusProcessing",
          "PaymentStatusSucceeded",
          "PaymentStatusOverpaid",
          "PaymentStatusFailed",
          "PaymentStatusRefunded",
          "PaymentStatusPartiallyRefunded",
          "PaymentStatusVoided"
        ],
        "x-speakeasy-name-override": "PaymentStatus"
      },
      "types.PaymentTerms": {
        "type": "string",
        "enum": [
          "15 NET",
          "30 NET",
          "45 NET",
          "60 NET",
          "75 NET",
          "90 NET"
        ],
        "x-enum-varnames": [
          "PaymentTerms15Net",
          "PaymentTerms30Net",
          "PaymentTerms45Net",
          "PaymentTerms60Net",
          "PaymentTerms75Net",
          "PaymentTerms90Net"
        ],
        "x-speakeasy-name-override": "PaymentTerms"
      },
      "types.PlanFilter": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "expand": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "description": "filters allows complex filtering based on multiple fields",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "plan_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          }
        },
        "x-speakeasy-name-override": "PlanFilter"
      },
      "types.PriceEntityType": {
        "type": "string",
        "enum": [
          "PLAN",
          "SUBSCRIPTION",
          "ADDON",
          "PRICE",
          "COSTSHEET"
        ],
        "x-enum-varnames": [
          "PRICE_ENTITY_TYPE_PLAN",
          "PRICE_ENTITY_TYPE_SUBSCRIPTION",
          "PRICE_ENTITY_TYPE_ADDON",
          "PRICE_ENTITY_TYPE_PRICE",
          "PRICE_ENTITY_TYPE_COSTSHEET"
        ],
        "x-speakeasy-name-override": "PriceEntityType"
      },
      "types.PriceFilter": {
        "type": "object",
        "properties": {
          "allow_expired_prices": {
            "type": "boolean",
            "default": false
          },
          "billing_periods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.BillingPeriod"
            }
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "entity_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.PriceEntityType"
          },
          "expand": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "description": "DSL filters",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "meter_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "parent_price_id": {
            "type": "string"
          },
          "plan_ids": {
            "type": "array",
            "description": "Price override filtering fields",
            "items": {
              "type": "string"
            }
          },
          "price_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "type": "string"
          },
          "start_date_lt": {
            "type": "string"
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_id": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "PriceFilter"
      },
      "types.PriceType": {
        "type": "string",
        "enum": [
          "USAGE",
          "FIXED"
        ],
        "x-enum-varnames": [
          "PRICE_TYPE_USAGE",
          "PRICE_TYPE_FIXED"
        ],
        "x-speakeasy-name-override": "PriceType"
      },
      "types.PriceUnitFilter": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "expand": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "description": "filters allows complex filtering based on multiple fields",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "price_unit_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          }
        },
        "x-speakeasy-name-override": "PriceUnitFilter"
      },
      "types.PriceUnitType": {
        "type": "string",
        "enum": [
          "FIAT",
          "CUSTOM"
        ],
        "x-enum-varnames": [
          "PRICE_UNIT_TYPE_FIAT",
          "PRICE_UNIT_TYPE_CUSTOM"
        ],
        "x-speakeasy-name-override": "PriceUnitType"
      },
      "types.ProrationBehavior": {
        "type": "string",
        "enum": [
          "create_prorations",
          "none"
        ],
        "x-enum-comments": {
          "ProrationBehaviorCreateProrations": "Default: Create credits/charges on invoice",
          "ProrationBehaviorNone": "Calculate but don't apply (e.g., for previews)"
        },
        "x-enum-varnames": [
          "ProrationBehaviorCreateProrations",
          "ProrationBehaviorNone"
        ],
        "x-speakeasy-name-override": "ProrationBehavior"
      },
      "types.QueryFilter": {
        "type": "object",
        "properties": {
          "expand": {
            "type": "string"
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "sort": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          }
        },
        "x-speakeasy-name-override": "QueryFilter"
      },
      "types.RejectedEventReason": {
        "type": "string",
        "enum": [
          "no_meter_for_event_name",
          "no_matching_meter"
        ],
        "x-enum-varnames": [
          "RejectedEventReasonNoMeterForName",
          "RejectedEventReasonNoMatchingMeter"
        ],
        "x-speakeasy-name-override": "RejectedEventReason"
      },
      "types.ReportingUnit": {
        "type": "object",
        "properties": {
          "conversion_rate": {
            "type": "number",
            "description": "Multiplier: reporting_unit_value = unit_value * conversion_rate; must be > 0"
          },
          "unit_plural": {
            "type": "string",
            "description": "Display unit label, plural (e.g. \"seconds\")"
          },
          "unit_singular": {
            "type": "string",
            "description": "Display unit label, singular (e.g. \"second\")"
          }
        },
        "x-speakeasy-name-override": "ReportingUnit"
      },
      "types.ResetUsage": {
        "type": "string",
        "enum": [
          "BILLING_PERIOD",
          "NEVER"
        ],
        "x-enum-varnames": [
          "ResetUsageBillingPeriod",
          "ResetUsageNever"
        ],
        "x-speakeasy-name-override": "ResetUsage"
      },
      "types.ResumeMode": {
        "type": "string",
        "enum": [
          "immediate",
          "scheduled",
          "auto"
        ],
        "x-enum-varnames": [
          "ResumeModeImmediate",
          "ResumeModeScheduled",
          "ResumeModeAuto"
        ],
        "x-speakeasy-name-override": "ResumeMode"
      },
      "types.RoundType": {
        "type": "string",
        "enum": [
          "up",
          "down"
        ],
        "x-enum-varnames": [
          "ROUND_UP",
          "ROUND_DOWN"
        ],
        "x-speakeasy-name-override": "RoundType"
      },
      "types.S3CompressionType": {
        "type": "string",
        "enum": [
          "none",
          "gzip"
        ],
        "x-enum-varnames": [
          "S3CompressionTypeNone",
          "S3CompressionTypeGzip"
        ],
        "x-speakeasy-name-override": "S3CompressionType"
      },
      "types.S3EncryptionType": {
        "type": "string",
        "enum": [
          "AES256",
          "aws:kms",
          "aws:kms:dsse"
        ],
        "x-enum-varnames": [
          "S3EncryptionTypeAES256",
          "S3EncryptionTypeAwsKms",
          "S3EncryptionTypeAwsKmsDsse"
        ],
        "x-speakeasy-name-override": "S3EncryptionType"
      },
      "types.S3ExportConfig": {
        "type": "object",
        "properties": {
          "bucket": {
            "type": "string",
            "description": "S3 bucket name"
          },
          "compression": {
            "$ref": "#/components/schemas/types.S3CompressionType"
          },
          "encryption": {
            "$ref": "#/components/schemas/types.S3EncryptionType"
          },
          "is_flexprice_managed": {
            "type": "boolean",
            "description": "If true, use Flexprice-managed S3 credentials instead of user-provided"
          },
          "key_prefix": {
            "type": "string",
            "description": "Optional prefix for S3 keys (e.g., \"flexprice-exports/\")"
          },
          "region": {
            "type": "string",
            "description": "AWS region (e.g., \"us-west-2\")"
          }
        },
        "x-speakeasy-name-override": "S3ExportConfig"
      },
      "types.S3JobConfig": {
        "type": "object",
        "properties": {
          "bucket": {
            "type": "string",
            "description": "S3 bucket name"
          },
          "compression": {
            "$ref": "#/components/schemas/types.S3CompressionType"
          },
          "encryption": {
            "$ref": "#/components/schemas/types.S3EncryptionType"
          },
          "endpoint_url": {
            "type": "string",
            "description": "Custom S3-compatible endpoint URL; must be https on a publicly routable host"
          },
          "export_metadata_fields": {
            "type": "array",
            "description": "Optional user-selected metadata columns",
            "items": {
              "$ref": "#/components/schemas/types.ExportMetadataField"
            }
          },
          "key_prefix": {
            "type": "string",
            "description": "Optional prefix for S3 keys (e.g., \"flexprice-exports/\")"
          },
          "region": {
            "type": "string",
            "description": "AWS region (e.g., \"us-west-2\")"
          },
          "use_path_style": {
            "type": "boolean",
            "description": "Use path-style addressing (required for MinIO)"
          }
        },
        "x-speakeasy-name-override": "S3JobConfig"
      },
      "types.ScheduleStatus": {
        "type": "string",
        "enum": [
          "pending",
          "executing",
          "executed",
          "cancelled",
          "failed"
        ],
        "x-enum-varnames": [
          "ScheduleStatusPending",
          "ScheduleStatusExecuting",
          "ScheduleStatusExecuted",
          "ScheduleStatusCancelled",
          "ScheduleStatusFailed"
        ],
        "x-speakeasy-name-override": "ScheduleStatus"
      },
      "types.ScheduleType": {
        "type": "string",
        "enum": [
          "immediate",
          "end_of_period"
        ],
        "x-enum-varnames": [
          "ScheduleTypeImmediate",
          "ScheduleTypePeriodEnd"
        ],
        "x-speakeasy-name-override": "ScheduleType"
      },
      "types.ScheduledTaskEntityType": {
        "type": "string",
        "enum": [
          "events",
          "invoice",
          "credit_topups",
          "credit_usage",
          "usage_analytics"
        ],
        "x-enum-varnames": [
          "ScheduledTaskEntityTypeEvents",
          "ScheduledTaskEntityTypeInvoice",
          "ScheduledTaskEntityTypeCreditTopups",
          "ScheduledTaskEntityTypeCreditUsage",
          "ScheduledTaskEntityTypeUsageAnalytics"
        ],
        "x-speakeasy-name-override": "ScheduledTaskEntityType"
      },
      "types.ScheduledTaskInterval": {
        "type": "string",
        "enum": [
          "15MIN",
          "30MIN",
          "custom",
          "hourly",
          "daily"
        ],
        "x-enum-comments": {
          "ScheduledTaskIntervalCustom": "10 minutes for testing"
        },
        "x-enum-varnames": [
          "ScheduledTaskIntervalEvery15Minutes",
          "ScheduledTaskIntervalEvery30Minutes",
          "ScheduledTaskIntervalCustom",
          "ScheduledTaskIntervalHourly",
          "ScheduledTaskIntervalDaily"
        ],
        "x-speakeasy-name-override": "ScheduledTaskInterval"
      },
      "types.SecretProvider": {
        "type": "string",
        "enum": [
          "flexprice",
          "stripe",
          "s3",
          "hubspot",
          "razorpay",
          "chargebee",
          "quickbooks",
          "zoho_books",
          "nomod",
          "moyasar",
          "paddle",
          "whop",
          "tabs",
          "aws_marketplace",
          "gcp_marketplace",
          "azure_marketplace"
        ],
        "x-enum-comments": {
          "SecretProviderS3": "supports multiple connections per environment"
        },
        "x-enum-varnames": [
          "SecretProviderFlexPrice",
          "SecretProviderStripe",
          "SecretProviderS3",
          "SecretProviderHubSpot",
          "SecretProviderRazorpay",
          "SecretProviderChargebee",
          "SecretProviderQuickBooks",
          "SecretProviderZohoBooks",
          "SecretProviderNomod",
          "SecretProviderMoyasar",
          "SecretProviderPaddle",
          "SecretProviderWhop",
          "SecretProviderTabs",
          "SecretProviderAWSMarketplace",
          "SecretProviderGCPMarketplace",
          "SecretProviderAzureMarketplace"
        ],
        "x-speakeasy-name-override": "SecretProvider"
      },
      "types.SecretType": {
        "type": "string",
        "enum": [
          "private_key",
          "publishable_key",
          "integration"
        ],
        "x-enum-varnames": [
          "SecretTypePrivateKey",
          "SecretTypePublishableKey",
          "SecretTypeIntegration"
        ],
        "x-speakeasy-name-override": "SecretType"
      },
      "types.SortCondition": {
        "type": "object",
        "properties": {
          "direction": {
            "$ref": "#/components/schemas/types.SortDirection"
          },
          "field": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "SortCondition"
      },
      "types.SortDirection": {
        "type": "string",
        "enum": [
          "asc",
          "desc"
        ],
        "x-enum-varnames": [
          "SortDirectionAsc",
          "SortDirectionDesc"
        ],
        "x-speakeasy-name-override": "SortDirection"
      },
      "types.Status": {
        "type": "string",
        "enum": [
          "published",
          "deleted",
          "archived"
        ],
        "x-enum-varnames": [
          "StatusPublished",
          "StatusDeleted",
          "StatusArchived"
        ],
        "x-speakeasy-name-override": "Status"
      },
      "types.SubscriptionChangeType": {
        "type": "string",
        "enum": [
          "upgrade",
          "downgrade",
          "lateral"
        ],
        "x-enum-varnames": [
          "SubscriptionChangeTypeUpgrade",
          "SubscriptionChangeTypeDowngrade",
          "SubscriptionChangeTypeLateral"
        ],
        "x-speakeasy-name-override": "SubscriptionChangeType"
      },
      "types.SubscriptionFilter": {
        "type": "object",
        "properties": {
          "active_at": {
            "type": "string",
            "description": "ActiveAt filters subscriptions that are active at the given time",
            "format": "date-time"
          },
          "billing_cadence": {
            "type": "array",
            "description": "BillingCadence filters by billing cadence",
            "items": {
              "$ref": "#/components/schemas/types.BillingCadence"
            }
          },
          "billing_period": {
            "type": "array",
            "description": "BillingPeriod filters by billing period",
            "items": {
              "$ref": "#/components/schemas/types.BillingPeriod"
            }
          },
          "customer_id": {
            "type": "string",
            "description": "CustomerID filters by customer ID"
          },
          "customer_ids": {
            "type": "array",
            "description": "CustomerIDs filters by customer IDs",
            "items": {
              "type": "string"
            }
          },
          "effective_date_for_update": {
            "type": "string",
            "description": "EffectiveDateForUpdate selects subscriptions that need a billing-period pass on or before this time:\ncurrent_period_end <= date OR (cancel_at IS NOT NULL AND cancel_at <= date).\nWhen nil, period/cancel cutoff logic is not applied by this field (see TimeRangeFilter for legacy period-end filtering)."
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "expand": {
            "type": "string"
          },
          "external_customer_id": {
            "type": "string",
            "description": "ExternalCustomerID filters by external customer ID"
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "invoicing_customer_ids": {
            "type": "array",
            "description": "InvoicingCustomerIDs filters by invoicing customer ID",
            "items": {
              "type": "string"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "parent_subscription_ids": {
            "type": "array",
            "description": "ParentSubscriptionIDs filters by parent subscription IDs",
            "items": {
              "type": "string"
            }
          },
          "plan_id": {
            "type": "string",
            "description": "PlanID filters by plan ID"
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subscription_status": {
            "type": "array",
            "description": "SubscriptionStatus filters by subscription status",
            "items": {
              "$ref": "#/components/schemas/types.SubscriptionStatus"
            }
          },
          "subscription_type": {
            "type": "array",
            "description": "SubscriptionType filters by subscription type",
            "items": {
              "$ref": "#/components/schemas/types.SubscriptionType"
            }
          },
          "trial_end_due_lte": {
            "type": "string",
            "description": "TrialEndDueLTE, when set, restricts to subscriptions with trial_end not nil and trial_end <= trial_end_due_lte.\nUse with subscription_status trialing for trial-end cron processing.",
            "format": "date-time"
          },
          "with_coupon_associations": {
            "type": "boolean",
            "description": "WithCouponAssociations eager-loads coupon associations and their coupons.\n\nKept separate from WithLineItems because the coupon_associations table has no\nindex leading with subscription_id, so Ent's edge load degrades to a full table\nscan. Only set it when the response actually surfaces the associations; the\nservice layer back-fills it from expand=\"coupon_associations\"."
          },
          "with_line_items": {
            "type": "boolean",
            "description": "WithLineItems includes line items in the response.\n\nDeprecated: use expand=\"subscription_line_items\" instead. Retained for\nbackwards compatibility and for internal callers that need to force-disable\nline item loading (set to false). The service layer ORs this with the\nexpand check before invoking the repository."
          }
        },
        "x-speakeasy-name-override": "SubscriptionFilter"
      },
      "types.SubscriptionLineItemEntityType": {
        "type": "string",
        "enum": [
          "plan",
          "addon",
          "subscription"
        ],
        "x-enum-varnames": [
          "SubscriptionLineItemEntityTypePlan",
          "SubscriptionLineItemEntityTypeAddon",
          "SubscriptionLineItemEntityTypeSubscription"
        ],
        "x-speakeasy-name-override": "SubscriptionLineItemEntityType"
      },
      "types.SubscriptionLineItemFilter": {
        "type": "object",
        "properties": {
          "active_filter": {
            "type": "boolean",
            "default": true
          },
          "addon_association_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "billing_periods": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "current_period_start": {
            "type": "string",
            "format": "date-time"
          },
          "customer_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "entity_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.SubscriptionLineItemEntityType"
          },
          "expand": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "meter_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "price_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "subscription_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subscription_line_item_ids": {
            "type": "array",
            "description": "Specific filters",
            "items": {
              "type": "string"
            }
          }
        },
        "x-speakeasy-name-override": "SubscriptionLineItemFilter"
      },
      "types.SubscriptionScheduleChangeType": {
        "type": "string",
        "enum": [
          "plan_change",
          "cancellation"
        ],
        "x-enum-varnames": [
          "SubscriptionScheduleChangeTypePlanChange",
          "SubscriptionScheduleChangeTypeCancellation"
        ],
        "x-speakeasy-name-override": "SubscriptionScheduleChangeType"
      },
      "types.SubscriptionStatus": {
        "type": "string",
        "enum": [
          "active",
          "paused",
          "cancelled",
          "incomplete",
          "trialing",
          "draft"
        ],
        "x-enum-varnames": [
          "SubscriptionStatusActive",
          "SubscriptionStatusPaused",
          "SubscriptionStatusCancelled",
          "SubscriptionStatusIncomplete",
          "SubscriptionStatusTrialing",
          "SubscriptionStatusDraft"
        ],
        "x-speakeasy-name-override": "SubscriptionStatus"
      },
      "types.SubscriptionType": {
        "type": "string",
        "enum": [
          "standalone",
          "delegated_invoicing",
          "parent",
          "inherited",
          "grouped_invoicing"
        ],
        "x-enum-varnames": [
          "SubscriptionTypeStandalone",
          "SubscriptionTypeDelegatedInvoicing",
          "SubscriptionTypeParent",
          "SubscriptionTypeInherited",
          "SubscriptionTypeGroupedInvoicing"
        ],
        "x-speakeasy-name-override": "SubscriptionType"
      },
      "types.SyncConfig": {
        "type": "object",
        "properties": {
          "aws_marketplace": {
            "$ref": "#/components/schemas/types.AWSMarketplaceSyncConfig"
          },
          "customer": {
            "$ref": "#/components/schemas/types.EntitySyncConfig"
          },
          "deal": {
            "$ref": "#/components/schemas/types.EntitySyncConfig"
          },
          "invoice": {
            "$ref": "#/components/schemas/types.EntitySyncConfig"
          },
          "invoice_sync_settings": {
            "$ref": "#/components/schemas/types.InvoiceSyncSettings"
          },
          "payment": {
            "$ref": "#/components/schemas/types.EntitySyncConfig"
          },
          "plan": {
            "$ref": "#/components/schemas/types.EntitySyncConfig"
          },
          "price": {
            "$ref": "#/components/schemas/types.EntitySyncConfig"
          },
          "quote": {
            "$ref": "#/components/schemas/types.EntitySyncConfig"
          },
          "s3": {
            "$ref": "#/components/schemas/types.S3ExportConfig"
          },
          "subscription": {
            "$ref": "#/components/schemas/types.EntitySyncConfig"
          }
        },
        "x-speakeasy-name-override": "SyncConfig"
      },
      "types.TaskStatus": {
        "type": "string",
        "enum": [
          "PENDING",
          "PROCESSING",
          "COMPLETED",
          "FAILED"
        ],
        "x-enum-varnames": [
          "TaskStatusPending",
          "TaskStatusProcessing",
          "TaskStatusCompleted",
          "TaskStatusFailed"
        ],
        "x-speakeasy-name-override": "TaskStatus"
      },
      "types.TaskType": {
        "type": "string",
        "enum": [
          "IMPORT",
          "EXPORT"
        ],
        "x-enum-varnames": [
          "TaskTypeImport",
          "TaskTypeExport"
        ],
        "x-speakeasy-name-override": "TaskType"
      },
      "types.TaxRateEntityType": {
        "type": "string",
        "enum": [
          "customer",
          "subscription",
          "invoice",
          "tenant"
        ],
        "x-enum-varnames": [
          "TaxRateEntityTypeCustomer",
          "TaxRateEntityTypeSubscription",
          "TaxRateEntityTypeInvoice",
          "TaxRateEntityTypeTenant"
        ],
        "x-speakeasy-name-override": "TaxRateEntityType"
      },
      "types.TaxRateScope": {
        "type": "string",
        "enum": [
          "INTERNAL",
          "EXTERNAL",
          "ONETIME"
        ],
        "x-enum-varnames": [
          "TaxRateScopeInternal",
          "TaxRateScopeExternal",
          "TaxRateScopeOneTime"
        ],
        "x-speakeasy-name-override": "TaxRateScope"
      },
      "types.TaxRateStatus": {
        "type": "string",
        "enum": [
          "ACTIVE",
          "INACTIVE"
        ],
        "x-enum-varnames": [
          "TaxRateStatusActive",
          "TaxRateStatusInactive"
        ],
        "x-speakeasy-name-override": "TaxRateStatus"
      },
      "types.TaxRateType": {
        "type": "string",
        "enum": [
          "percentage",
          "fixed"
        ],
        "x-enum-varnames": [
          "TaxRateTypePercentage",
          "TaxRateTypeFixed"
        ],
        "x-speakeasy-name-override": "TaxRateType"
      },
      "types.TimeOfDayBucket": {
        "type": "object",
        "properties": {
          "commitment_type": {
            "$ref": "#/components/schemas/types.CommitmentType"
          },
          "commitment_value": {
            "type": "string"
          },
          "end": {
            "$ref": "#/components/schemas/types.Bucket"
          },
          "id": {
            "type": "string",
            "description": "ID is server-assigned. Stable for the lifetime of the line item;\ninvoice breakdown and analytics responses reference this ID."
          },
          "overage_factor": {
            "type": "number"
          },
          "price_id": {
            "type": "string",
            "description": "PriceID is the SUBSCRIPTION-scoped price created at bucket-creation time.\nImmutable post-create; changing pricing requires a successor line item."
          },
          "start": {
            "$ref": "#/components/schemas/types.Bucket"
          },
          "true_up_enabled": {
            "type": "boolean"
          }
        },
        "x-speakeasy-name-override": "TimeOfDayBucket"
      },
      "types.TimeRangeFilter": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          }
        },
        "x-speakeasy-name-override": "TimeRangeFilter"
      },
      "types.TransactionReason": {
        "type": "string",
        "enum": [
          "INVOICE_PAYMENT",
          "FREE_CREDIT_GRANT",
          "SUBSCRIPTION_CREDIT_GRANT",
          "PURCHASED_CREDIT_INVOICED",
          "PURCHASED_CREDIT_DIRECT",
          "CREDIT_NOTE",
          "CREDIT_EXPIRED",
          "WALLET_TERMINATION",
          "MANUAL_BALANCE_DEBIT",
          "CREDIT_ADJUSTMENT",
          "INVOICE_VOID_REFUND",
          "PURCHASED_CREDIT_BONUS"
        ],
        "x-enum-varnames": [
          "TransactionReasonInvoicePayment",
          "TransactionReasonFreeCredit",
          "TransactionReasonSubscriptionCredit",
          "TransactionReasonPurchasedCreditInvoiced",
          "TransactionReasonPurchasedCreditDirect",
          "TransactionReasonCreditNote",
          "TransactionReasonCreditExpired",
          "TransactionReasonWalletTermination",
          "TransactionReasonManualBalanceDebit",
          "TransactionReasonCreditAdjustment",
          "TransactionReasonInvoiceVoidRefund",
          "TransactionReasonPurchasedCreditBonus"
        ],
        "x-speakeasy-name-override": "TransactionReason"
      },
      "types.TransactionStatus": {
        "type": "string",
        "enum": [
          "pending",
          "completed",
          "failed"
        ],
        "x-enum-varnames": [
          "TransactionStatusPending",
          "TransactionStatusCompleted",
          "TransactionStatusFailed"
        ],
        "x-speakeasy-name-override": "TransactionStatus"
      },
      "types.TransactionType": {
        "type": "string",
        "enum": [
          "credit",
          "debit"
        ],
        "x-enum-varnames": [
          "TransactionTypeCredit",
          "TransactionTypeDebit"
        ],
        "x-speakeasy-name-override": "TransactionType"
      },
      "types.UserFilter": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "expand": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "description": "filters allows complex filtering based on multiple fields",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "type": {
            "$ref": "#/components/schemas/types.UserType"
          },
          "user_ids": {
            "type": "array",
            "description": "Specific filters for users",
            "items": {
              "type": "string"
            }
          }
        },
        "x-speakeasy-name-override": "UserFilter"
      },
      "types.UserType": {
        "type": "string",
        "enum": [
          "user",
          "service_account"
        ],
        "x-enum-varnames": [
          "UserTypeUser",
          "UserTypeServiceAccount"
        ],
        "x-speakeasy-name-override": "UserType"
      },
      "types.WalletConfig": {
        "type": "object",
        "properties": {
          "allowed_price_types": {
            "type": "array",
            "description": "AllowedPriceTypes is a list of price types that are allowed for the wallet\nnil means all price types are allowed",
            "items": {
              "$ref": "#/components/schemas/types.WalletConfigPriceType"
            }
          }
        },
        "x-speakeasy-name-override": "WalletConfig"
      },
      "types.WalletConfigPriceType": {
        "type": "string",
        "enum": [
          "ALL",
          "USAGE",
          "FIXED"
        ],
        "x-enum-varnames": [
          "WalletConfigPriceTypeAll",
          "WalletConfigPriceTypeUsage",
          "WalletConfigPriceTypeFixed"
        ],
        "x-speakeasy-name-override": "WalletConfigPriceType"
      },
      "types.WalletFilter": {
        "type": "object",
        "properties": {
          "alert_enabled": {
            "type": "boolean"
          },
          "expand": {
            "type": "string"
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "sort": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/types.WalletStatus"
          },
          "wallet_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "x-speakeasy-name-override": "WalletFilter"
      },
      "types.WalletStatus": {
        "type": "string",
        "enum": [
          "active",
          "frozen",
          "closed"
        ],
        "x-enum-varnames": [
          "WalletStatusActive",
          "WalletStatusFrozen",
          "WalletStatusClosed"
        ],
        "x-speakeasy-name-override": "WalletStatus"
      },
      "types.WalletTopupParams": {
        "required": [
          "wallet_id"
        ],
        "type": "object",
        "properties": {
          "wallet_id": {
            "type": "string"
          },
          "wallet_transaction_id": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "WalletTopupParams"
      },
      "types.WalletTransactionFilter": {
        "type": "object",
        "properties": {
          "created_by": {
            "type": "string"
          },
          "credits_available_gt": {
            "type": "number"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "expand": {
            "type": "string"
          },
          "expiry_date_after": {
            "type": "string"
          },
          "expiry_date_before": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "description": "filters allows complex filtering based on multiple fields",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "id": {
            "type": "string"
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "priority": {
            "type": "integer"
          },
          "reference_id": {
            "type": "string"
          },
          "reference_type": {
            "type": "string"
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "transaction_reason": {
            "$ref": "#/components/schemas/types.TransactionReason"
          },
          "transaction_status": {
            "$ref": "#/components/schemas/types.TransactionStatus"
          },
          "type": {
            "$ref": "#/components/schemas/types.TransactionType"
          }
        },
        "x-speakeasy-name-override": "WalletTransactionFilter"
      },
      "types.WalletTxReferenceType": {
        "type": "string",
        "enum": [
          "PAYMENT",
          "EXTERNAL",
          "REQUEST",
          "INVOICE"
        ],
        "x-enum-varnames": [
          "WalletTxReferenceTypePayment",
          "WalletTxReferenceTypeExternal",
          "WalletTxReferenceTypeRequest",
          "WalletTxReferenceTypeInvoice"
        ],
        "x-speakeasy-name-override": "WalletTxReferenceType"
      },
      "types.WalletType": {
        "type": "string",
        "enum": [
          "PRE_PAID",
          "POST_PAID"
        ],
        "x-enum-varnames": [
          "WalletTypePrePaid",
          "WalletTypePostPaid"
        ],
        "x-speakeasy-name-override": "WalletType"
      },
      "types.WebhookEventName": {
        "type": "string",
        "enum": [
          "subscription.created",
          "subscription.draft.created",
          "subscription.activated",
          "subscription.updated",
          "subscription.paused",
          "subscription.cancelled",
          "subscription.resumed",
          "subscription.plan_changed",
          "subscription.phase.created",
          "subscription.phase.updated",
          "subscription.phase.deleted",
          "feature.created",
          "feature.updated",
          "feature.deleted",
          "feature.wallet_balance.alert",
          "entitlement.created",
          "entitlement.updated",
          "entitlement.deleted",
          "wallet.created",
          "wallet.updated",
          "wallet.terminated",
          "wallet.transaction.created",
          "wallet.transaction.updated",
          "payment.created",
          "payment.updated",
          "payment.failed",
          "payment.success",
          "payment.pending",
          "customer.created",
          "customer.updated",
          "customer.deleted",
          "invoice.update.finalized",
          "invoice.update.payment",
          "invoice.update.voided",
          "invoice.update",
          "invoice.payment.overdue",
          "wallet.credit_balance.dropped",
          "wallet.credit_balance.recovered",
          "wallet.ongoing_balance.dropped",
          "wallet.ongoing_balance.recovered",
          "wallet.ongoing_balance.updated",
          "subscription.spend.threshold_reached",
          "subscription.spend.threshold_recovered",
          "subscription.line_item_spend.threshold_reached",
          "subscription.line_item_spend.threshold_recovered",
          "subscription.group_spend.threshold_reached",
          "subscription.group_spend.threshold_recovered",
          "entitlement.grant.exhausted",
          "subscription.renewal.due",
          "invoice.communication.triggered",
          "credit_note.created",
          "credit_note.updated",
          "checkout.session.initiated",
          "checkout.session.completed",
          "checkout.session.failed",
          "checkout.session.expired",
          "event.rejected"
        ],
        "x-enum-varnames": [
          "WebhookEventSubscriptionCreated",
          "WebhookEventSubscriptionDraftCreated",
          "WebhookEventSubscriptionActivated",
          "WebhookEventSubscriptionUpdated",
          "WebhookEventSubscriptionPaused",
          "WebhookEventSubscriptionCancelled",
          "WebhookEventSubscriptionResumed",
          "WebhookEventSubscriptionPlanChanged",
          "WebhookEventSubscriptionPhaseCreated",
          "WebhookEventSubscriptionPhaseUpdated",
          "WebhookEventSubscriptionPhaseDeleted",
          "WebhookEventFeatureCreated",
          "WebhookEventFeatureUpdated",
          "WebhookEventFeatureDeleted",
          "WebhookEventFeatureWalletBalanceAlert",
          "WebhookEventEntitlementCreated",
          "WebhookEventEntitlementUpdated",
          "WebhookEventEntitlementDeleted",
          "WebhookEventWalletCreated",
          "WebhookEventWalletUpdated",
          "WebhookEventWalletTerminated",
          "WebhookEventWalletTransactionCreated",
          "WebhookEventWalletTransactionUpdated",
          "WebhookEventPaymentCreated",
          "WebhookEventPaymentUpdated",
          "WebhookEventPaymentFailed",
          "WebhookEventPaymentSuccess",
          "WebhookEventPaymentPending",
          "WebhookEventCustomerCreated",
          "WebhookEventCustomerUpdated",
          "WebhookEventCustomerDeleted",
          "WebhookEventInvoiceUpdateFinalized",
          "WebhookEventInvoiceUpdatePayment",
          "WebhookEventInvoiceUpdateVoided",
          "WebhookEventInvoiceUpdate",
          "WebhookEventInvoicePaymentOverdue",
          "WebhookEventWalletCreditBalanceDropped",
          "WebhookEventWalletCreditBalanceRecovered",
          "WebhookEventWalletOngoingBalanceDropped",
          "WebhookEventWalletOngoingBalanceRecovered",
          "WebhookEventWalletOngoingBalanceUpdated",
          "WebhookEventSubscriptionSpendThresholdReached",
          "WebhookEventSubscriptionSpendThresholdRecovered",
          "WebhookEventSubscriptionLineItemSpendThresholdReached",
          "WebhookEventSubscriptionLineItemSpendThresholdRecovered",
          "WebhookEventSubscriptionGroupSpendThresholdReached",
          "WebhookEventSubscriptionGroupSpendThresholdRecovered",
          "WebhookEventEntitlementGrantExhausted",
          "WebhookEventSubscriptionRenewalDue",
          "WebhookEventInvoiceCommunicationTriggered",
          "WebhookEventCreditNoteCreated",
          "WebhookEventCreditNoteUpdated",
          "WebhookEventCheckoutSessionInitiated",
          "WebhookEventCheckoutSessionCompleted",
          "WebhookEventCheckoutSessionFailed",
          "WebhookEventCheckoutSessionExpired",
          "WebhookEventEventRejected"
        ],
        "x-speakeasy-name-override": "WebhookEventName"
      },
      "types.WindowSize": {
        "type": "string",
        "enum": [
          "MINUTE",
          "15MIN",
          "30MIN",
          "HOUR",
          "3HOUR",
          "6HOUR",
          "12HOUR",
          "DAY",
          "WEEK",
          "MONTH"
        ],
        "x-enum-varnames": [
          "WindowSizeMinute",
          "WindowSize15Min",
          "WindowSize30Min",
          "WindowSizeHour",
          "WindowSize3Hour",
          "WindowSize6Hour",
          "WindowSize12Hour",
          "WindowSizeDay",
          "WindowSizeWeek",
          "WindowSizeMonth"
        ],
        "x-speakeasy-name-override": "WindowSize"
      },
      "types.WorkflowExecutionFilter": {
        "type": "object",
        "properties": {
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "entity": {
            "type": "string",
            "description": "e.g. plan, invoice, subscription"
          },
          "entity_id": {
            "type": "string",
            "description": "e.g. plan_01ABC123"
          },
          "expand": {
            "type": "string"
          },
          "filters": {
            "type": "array",
            "description": "filters allows complex filtering based on multiple fields (same as FeatureFilter)",
            "items": {
              "$ref": "#/components/schemas/types.FilterCondition"
            }
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/types.SortCondition"
            }
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/types.Status"
          },
          "task_queue": {
            "type": "string"
          },
          "workflow_id": {
            "type": "string",
            "description": "Workflow-specific filters"
          },
          "workflow_status": {
            "type": "string",
            "description": "e.g. Running, Completed, Failed"
          },
          "workflow_type": {
            "type": "string"
          }
        },
        "x-speakeasy-name-override": "WorkflowExecutionFilter"
      },
      "webhookDto.AlertWebhookPayload": {
        "type": "object",
        "properties": {
          "alert_status": {
            "$ref": "#/components/schemas/types.AlertState"
          },
          "alert_type": {
            "$ref": "#/components/schemas/types.AlertType"
          },
          "credit_balance": {
            "type": "string"
          },
          "current_balance": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          },
          "feature_id": {
            "type": "string"
          },
          "wallet_id": {
            "type": "string"
          }
        }
      },
      "webhookDto.CheckoutSession": {
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/types.CheckoutAction"
          },
          "cancelled_at": {
            "type": "string",
            "format": "date-time"
          },
          "checkout_invoice_id": {
            "type": "string"
          },
          "checkout_payment_id": {
            "type": "string"
          },
          "checkout_status": {
            "$ref": "#/components/schemas/types.CheckoutStatus"
          },
          "completed_at": {
            "type": "string",
            "format": "date-time"
          },
          "customer_id": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "failure_reason": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "payment_action": {
            "$ref": "#/components/schemas/types.PaymentAction"
          },
          "payment_provider": {
            "$ref": "#/components/schemas/types.CheckoutPaymentProvider"
          }
        }
      },
      "webhookDto.CheckoutSessionWebhookPayload": {
        "type": "object",
        "properties": {
          "checkout_session": {
            "$ref": "#/components/schemas/webhookDto.CheckoutSession"
          },
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          }
        }
      },
      "webhookDto.CommunicationWebhookPayload": {
        "type": "object",
        "properties": {
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          },
          "invoice": {
            "$ref": "#/components/schemas/webhookDto.Invoice"
          }
        }
      },
      "webhookDto.CreditNote": {
        "type": "object",
        "properties": {
          "credit_note_number": {
            "type": "string"
          },
          "credit_note_status": {
            "$ref": "#/components/schemas/types.CreditNoteStatus"
          },
          "credit_note_type": {
            "$ref": "#/components/schemas/types.CreditNoteType"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "finalized_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "invoice_id": {
            "type": "string"
          },
          "memo": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "reason": {
            "$ref": "#/components/schemas/types.CreditNoteReason"
          },
          "subscription_id": {
            "type": "string"
          },
          "total_amount": {
            "type": "string"
          },
          "voided_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "webhookDto.CreditNoteWebhookPayload": {
        "type": "object",
        "properties": {
          "credit_note": {
            "$ref": "#/components/schemas/webhookDto.CreditNote"
          },
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          }
        }
      },
      "webhookDto.Customer": {
        "type": "object",
        "properties": {
          "address_city": {
            "type": "string"
          },
          "address_country": {
            "type": "string"
          },
          "address_line1": {
            "type": "string"
          },
          "address_line2": {
            "type": "string"
          },
          "address_postal_code": {
            "type": "string"
          },
          "address_state": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          }
        }
      },
      "webhookDto.CustomerWebhookPayload": {
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/webhookDto.Customer"
          },
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          }
        }
      },
      "webhookDto.Entitlement": {
        "type": "object",
        "properties": {
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/types.EntitlementEntityType"
          },
          "feature_id": {
            "type": "string"
          },
          "feature_type": {
            "$ref": "#/components/schemas/types.FeatureType"
          },
          "id": {
            "type": "string"
          },
          "is_enabled": {
            "type": "boolean"
          },
          "is_soft_limit": {
            "type": "boolean"
          },
          "static_value": {
            "type": "string"
          },
          "usage_limit": {
            "type": "integer"
          },
          "usage_reset_period": {
            "$ref": "#/components/schemas/types.EntitlementUsageResetPeriod"
          }
        }
      },
      "webhookDto.EntitlementWebhookPayload": {
        "type": "object",
        "properties": {
          "entitlement": {
            "$ref": "#/components/schemas/webhookDto.Entitlement"
          },
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          }
        }
      },
      "webhookDto.Feature": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "group_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "meter_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/types.FeatureType"
          },
          "unit_plural": {
            "type": "string"
          },
          "unit_singular": {
            "type": "string"
          }
        }
      },
      "webhookDto.FeatureWebhookPayload": {
        "type": "object",
        "properties": {
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          },
          "feature": {
            "$ref": "#/components/schemas/webhookDto.Feature"
          }
        }
      },
      "webhookDto.Invoice": {
        "type": "object",
        "properties": {
          "amount_due": {
            "type": "string"
          },
          "amount_paid": {
            "type": "string"
          },
          "amount_remaining": {
            "type": "string"
          },
          "billing_reason": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer": {
            "$ref": "#/components/schemas/webhookDto.Customer"
          },
          "customer_id": {
            "type": "string"
          },
          "due_date": {
            "type": "string",
            "format": "date-time"
          },
          "finalized_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "invoice_number": {
            "type": "string"
          },
          "invoice_pdf_url": {
            "type": "string"
          },
          "invoice_status": {
            "$ref": "#/components/schemas/types.InvoiceStatus"
          },
          "invoice_type": {
            "$ref": "#/components/schemas/types.InvoiceType"
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/webhookDto.InvoiceLineItem"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "paid_at": {
            "type": "string",
            "format": "date-time"
          },
          "payment_status": {
            "$ref": "#/components/schemas/types.PaymentStatus"
          },
          "period_end": {
            "type": "string",
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "format": "date-time"
          },
          "subscription": {
            "$ref": "#/components/schemas/webhookDto.Subscription"
          },
          "subscription_id": {
            "type": "string"
          },
          "subtotal": {
            "type": "string"
          },
          "total": {
            "type": "string"
          },
          "voided_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "webhookDto.InvoiceLineItem": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "period_end": {
            "type": "string",
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "format": "date-time"
          },
          "plan_display_name": {
            "type": "string"
          },
          "price_id": {
            "type": "string"
          },
          "quantity": {
            "type": "string"
          }
        }
      },
      "webhookDto.InvoiceWebhookPayload": {
        "type": "object",
        "properties": {
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          },
          "invoice": {
            "$ref": "#/components/schemas/webhookDto.Invoice"
          }
        }
      },
      "webhookDto.Payment": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "destination_id": {
            "type": "string"
          },
          "destination_type": {
            "$ref": "#/components/schemas/types.PaymentDestinationType"
          },
          "error_message": {
            "type": "string"
          },
          "failed_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "invoice_number": {
            "type": "string"
          },
          "payment_gateway": {
            "type": "string"
          },
          "payment_method_type": {
            "$ref": "#/components/schemas/types.PaymentMethodType"
          },
          "payment_status": {
            "$ref": "#/components/schemas/types.PaymentStatus"
          },
          "refunded_at": {
            "type": "string",
            "format": "date-time"
          },
          "succeeded_at": {
            "type": "string",
            "format": "date-time"
          },
          "voided_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "webhookDto.PaymentWebhookPayload": {
        "type": "object",
        "properties": {
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          },
          "payment": {
            "$ref": "#/components/schemas/webhookDto.Payment"
          }
        }
      },
      "webhookDto.RejectedEventData": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "event_name": {
            "type": "string"
          },
          "external_customer_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "properties": {
            "type": "object",
            "additionalProperties": true
          },
          "source": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          }
        }
      },
      "webhookDto.RejectedEventWebhookPayload": {
        "type": "object",
        "properties": {
          "event": {
            "$ref": "#/components/schemas/webhookDto.RejectedEventData"
          },
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          },
          "reason": {
            "$ref": "#/components/schemas/types.RejectedEventReason"
          }
        }
      },
      "webhookDto.SpendAlertEvent": {
        "type": "object",
        "properties": {
          "alert_status": {
            "$ref": "#/components/schemas/types.AlertState"
          },
          "alert_type": {
            "$ref": "#/components/schemas/types.AlertType"
          },
          "current_spend": {
            "type": "string"
          },
          "group_id": {
            "type": "string"
          },
          "subscription": {
            "$ref": "#/components/schemas/webhookDto.Subscription"
          },
          "subscription_line_item_id": {
            "type": "string"
          },
          "threshold": {
            "type": "string"
          },
          "triggered_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "webhookDto.Subscription": {
        "type": "object",
        "properties": {
          "billing_cadence": {
            "$ref": "#/components/schemas/types.BillingCadence"
          },
          "billing_period": {
            "$ref": "#/components/schemas/types.BillingPeriod"
          },
          "billing_period_count": {
            "type": "integer"
          },
          "cancel_at": {
            "type": "string",
            "format": "date-time"
          },
          "cancel_at_period_end": {
            "type": "boolean"
          },
          "cancelled_at": {
            "type": "string",
            "format": "date-time"
          },
          "currency": {
            "type": "string"
          },
          "current_period_end": {
            "type": "string",
            "format": "date-time"
          },
          "current_period_start": {
            "type": "string",
            "format": "date-time"
          },
          "customer": {
            "$ref": "#/components/schemas/webhookDto.Customer"
          },
          "customer_id": {
            "type": "string"
          },
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "lookup_key": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "parent_subscription_id": {
            "type": "string"
          },
          "pause_status": {
            "$ref": "#/components/schemas/types.PauseStatus"
          },
          "plan_id": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "subscription_status": {
            "$ref": "#/components/schemas/types.SubscriptionStatus"
          },
          "subscription_type": {
            "$ref": "#/components/schemas/types.SubscriptionType"
          },
          "trial_end": {
            "type": "string",
            "format": "date-time"
          },
          "trial_start": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "webhookDto.SubscriptionPhase": {
        "type": "object",
        "properties": {
          "end_date": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "format": "date-time"
          },
          "subscription_id": {
            "type": "string"
          }
        }
      },
      "webhookDto.SubscriptionPhaseWebhookPayload": {
        "type": "object",
        "properties": {
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          },
          "phase": {
            "$ref": "#/components/schemas/webhookDto.SubscriptionPhase"
          }
        }
      },
      "webhookDto.SubscriptionWebhookPayload": {
        "type": "object",
        "properties": {
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          },
          "subscription": {
            "$ref": "#/components/schemas/webhookDto.Subscription"
          }
        }
      },
      "webhookDto.TransactionUpdatedWebhookPayload": {
        "type": "object",
        "properties": {
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          },
          "updated_transaction": {
            "$ref": "#/components/schemas/webhookDto.WalletTransaction"
          }
        }
      },
      "webhookDto.TransactionWebhookPayload": {
        "type": "object",
        "properties": {
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          },
          "transaction": {
            "$ref": "#/components/schemas/webhookDto.WalletTransaction"
          }
        }
      },
      "webhookDto.Wallet": {
        "type": "object",
        "properties": {
          "balance": {
            "type": "string"
          },
          "conversion_rate": {
            "type": "string"
          },
          "credit_balance": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "wallet_status": {
            "$ref": "#/components/schemas/types.WalletStatus"
          },
          "wallet_type": {
            "$ref": "#/components/schemas/types.WalletType"
          }
        }
      },
      "webhookDto.WalletAlertInfo": {
        "type": "object",
        "properties": {
          "alert_settings": {
            "$ref": "#/components/schemas/types.AlertSettings"
          },
          "alert_type": {
            "type": "string"
          },
          "credit_balance": {
            "type": "number"
          },
          "current_balance": {
            "type": "number"
          },
          "state": {
            "type": "string"
          }
        }
      },
      "webhookDto.WalletTransaction": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "credit_amount": {
            "type": "string"
          },
          "credit_balance_after": {
            "type": "string"
          },
          "credit_balance_before": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "expiry_date": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/types.Metadata"
          },
          "reference_id": {
            "type": "string"
          },
          "reference_type": {
            "$ref": "#/components/schemas/types.WalletTxReferenceType"
          },
          "transaction_reason": {
            "$ref": "#/components/schemas/types.TransactionReason"
          },
          "transaction_status": {
            "$ref": "#/components/schemas/types.TransactionStatus"
          },
          "type": {
            "$ref": "#/components/schemas/types.TransactionType"
          },
          "wallet_id": {
            "type": "string"
          }
        }
      },
      "webhookDto.WalletWebhookPayload": {
        "type": "object",
        "properties": {
          "alert": {
            "$ref": "#/components/schemas/webhookDto.WalletAlertInfo"
          },
          "event_type": {
            "$ref": "#/components/schemas/types.WebhookEventName"
          },
          "wallet": {
            "$ref": "#/components/schemas/webhookDto.Wallet"
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "description": "Enter your API key in the format *x-api-key &lt;api-key&gt;**",
        "name": "x-api-key",
        "in": "header"
      }
    }
  },
  "x-original-swagger-version": "2.0"
}