{"openapi":"3.1.0","info":{"title":"POST /api/v1/billing/migrate-from-grandfathered","version":"1.0.0","description":"Migrate grandfathered account to a paid plan"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/billing/migrate-from-grandfathered":{"post":{"tags":["billing"],"summary":"Migrate grandfathered account to a paid plan","description":"Create a Stripe Checkout session to move from a grandfathered plan to a paid plan.\n\n**Request Body:**\n- `target_plan`: Plan tier to migrate to (`self_directed` or `managed`)\n- `success_url`: Redirect URL after successful payment\n- `cancel_url`: Redirect URL if checkout is canceled\n\n**Prerequisites:**\n- Business must currently be on the `grandfathered` plan tier\n\n**Effect:**\n- Creates a Stripe Checkout session\n- On payment completion, `plan_tier` is updated to the target plan","operationId":"migrate_from_grandfathered_api_v1_billing_migrate_from_grandfathered_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrandfatheredMigrateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"GrandfatheredMigrateRequest":{"properties":{"target_plan":{"type":"string","title":"Target Plan","description":"Target plan tier: 'self_directed' or 'managed'."},"success_url":{"type":"string","title":"Success Url","description":"URL to redirect after successful payment."},"cancel_url":{"type":"string","title":"Cancel Url","description":"URL to redirect if checkout is canceled."}},"type":"object","required":["target_plan","success_url","cancel_url"],"title":"GrandfatheredMigrateRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}