{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getoneprofile-ai/json-schema/getoneprofile-ai-switch-plan-request-schema-schema.json",
  "title": "SwitchPlanRequestSchema",
  "description": "Request schema for switching subscription plan.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getoneprofile-ai-billing-api-openapi.yml#/components/schemas/SwitchPlanRequestSchema",
  "properties": {
    "billing_interval": {
      "default": "month",
      "description": "The billing interval to subscribe with.",
      "enum": [
        "month",
        "year"
      ],
      "title": "Billing Interval",
      "type": "string"
    },
    "cancel_path": {
      "description": "Partial path (e.g. /billing/plans) of where the stripe Checkout session should redirect the user if payment is cancelled.",
      "maxLength": 255,
      "minLength": 1,
      "title": "Cancel Path",
      "type": "string"
    },
    "credit_tier_key": {
      "anyOf": [
        {
          "maxLength": 50,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The credit tier to subscribe to (e.g. 'tier_20k'). Required for products with selectable credit tiers (the Team plan).",
      "title": "Credit Tier Key"
    },
    "new_product": {
      "$ref": "#/$defs/ProductTier",
      "description": "The new product to switch to."
    },
    "success_path": {
      "description": "Partial path (e.g. /billing/complete) of where the stripe Checkout session should redirect the user if payment is successful.",
      "maxLength": 255,
      "minLength": 1,
      "title": "Success Path",
      "type": "string"
    }
  },
  "required": [
    "success_path",
    "cancel_path",
    "new_product"
  ],
  "type": "object",
  "$defs": {
    "ProductTier": {
      "description": "The tier of a product in Stripe.\n\nDeclared cheapest-first. Free and Enterprise never touch Stripe: Free is\nfree, Enterprise is sales-led and has no self-serve price.\n\nA subscription's tier is recovered from its price's ``product_tier``\nmetadata, never by reverse-parsing a Stripe product name: a product is named\nfor the plan AND the credit volume it sells (\"Team Plan (10,000 credits)\"),\nso the name has not round-tripped to a tier since prices collapsed to one\nper plan+volume.",
      "enum": [
        "free_plan",
        "team_plan",
        "pro_plan",
        "enterprise_plan"
      ],
      "title": "ProductTier",
      "type": "string"
    }
  }
}