> ## Documentation Index
> Fetch the complete documentation index at: https://funnelfox.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate a subscription to a new plan

> Switch an active subscription to a different Price Point (plan).

Supports two migration strategies:

* **delayed\_start** - Schedules the new subscription to start when the customer’s already-paid time ends
* **price\_prorate** - Unused time is credited toward the new plan's first payment

The response includes the `migration_strategy` field showing which strategy was actually applied.

### Strict Mode

By default (`strict_mode: true`), if [the requested strategy isn't available](https://funnelfox.com/docs/billing/subscription-engine-subscription-management#how-migration-strategy-works), the API returns a 400 error. Set `strict_mode: false` to automatically switch to the alternative strategy when the selected one fails.

### Additional Options

Use `dry_run: true` to preview charges without executing the migration. Supports migrations from subscription to subscription or subscription to lifetime purchases.


## OpenAPI

````yaml /swagger/openapi-billing.json post /subscription/migration
openapi: 3.0.0
info:
  title: OpenAPI3
  version: 1.0.0
servers:
  - url: https://billing.funnelfox.com/{org_id}/v1
    description: FunnelFox Billing API
    variables:
      org_id:
        default: your-org-id
        description: Your organization ID
security:
  - FunnelFoxSecretKey: []
paths:
  /subscription/migration:
    post:
      tags:
        - Subscription management
      summary: Migrate a subscription to a new plan
      description: Switch an active subscription to a different Price Point (plan).
      parameters:
        - name: org_id
          in: path
          required: true
          description: Organization ID
          schema:
            type: string
          style: simple
          explode: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MigrationIn'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MigrationOut'
components:
  schemas:
    MigrationIn:
      properties:
        reason:
          default: ''
          description: Short reason code (e.g., "duplicate_payment", "unauthorized_charge")
          maxLength: 256
          title: Reason
          type: string
        comment:
          default: ''
          description: Human-readable comment or reference (e.g., support ticket link)
          maxLength: 2048
          title: Comment
          type: string
        external_id:
          description: Your unique identifier for the user
          maxLength: 256
          title: Customer Id
          type: string
          nullable: true
        subs_id:
          format: uuid
          title: Subs Id
          type: string
        pp_ident:
          description: Unique identifier of the price point
          maxLength: 256
          pattern: ^[-A-Za-z_0-9]{1,256}$
          title: price point ident
          type: string
        strategy:
          $ref: '#/components/schemas/MigrationStrategy'
          default: price_prorate
        dry_run:
          default: false
          title: Dry Run
          type: boolean
        strict_mode:
          default: true
          title: Strict Mode
          type: boolean
      required:
        - subs_id
        - pp_ident
      title: MigrationIn
      type: object
    MigrationOut:
      properties:
        payment_result:
          anyOf:
            - $ref: '#/components/schemas/CheckoutMigrationPaymentOut'
          default: null
          nullable: true
        charged_amount:
          anyOf:
            - type: number
            - type: string
          default: null
          title: Charged Amount
          nullable: true
        subs_id:
          format: uuid
          type: string
          nullable: true
        oneoff_id:
          format: uuid
          type: string
          nullable: true
        migration_strategy:
          $ref: '#/components/schemas/MigrationStrategy'
      required:
        - migration_strategy
      title: MigrationOut
      type: object
    MigrationStrategy:
      enum:
        - price_prorate
        - delayed_start
      title: MigrationStrategy
      type: string
    CheckoutMigrationPaymentOut:
      properties:
        checkout_status:
          $ref: '#/components/schemas/CheckoutPaymentStatus'
        failed_message_for_user:
          title: Failed Message For User
          type: string
        order_id:
          format: uuid
          type: string
          nullable: true
      required:
        - checkout_status
        - failed_message_for_user
        - order_id
      title: CheckoutMigrationPaymentOut
      type: object
    CheckoutPaymentStatus:
      enum:
        - processing
        - succeeded
        - failed
        - cancelled
      title: CheckoutPaymentStatus
      type: string
  securitySchemes:
    FunnelFoxSecretKey:
      type: apiKey
      in: header
      name: ff-secret-key
      description: Secret key for FunnelFox Billing API. Required for all requests.

````