v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.1 MB
Subscriptions

SwapPlan

Schedules a SWAP_PLAN action to swap a subscription plan variation in an existing subscription. For more information, see Swap Subscription Plan Variations.

post/v2/subscriptions/{subscription_id}/swap-plan

Path parameters

subscription_idstring required

The ID of the subscription to swap the subscription plan for.

Request body

new_plan_variation_idstring nullable

The ID of the new subscription plan variation.

This field is required.

Example request

{
  "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7",
  "phases": [
    {
      "order_template_id": "uhhnjH9osVv3shUADwaC0b3hNxQZY",
      "ordinal": 0
    }
  ]
}

Response

Success

Example response

{
  "actions": [
    {
      "effective_date": "2023-11-17",
      "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83",
      "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7",
      "phases": [
        {
          "order_template_id": "uhhnjH9osVv3shUADwaC0b3hNxQZY",
          "ordinal": 0
        }
      ],
      "type": "SWAP_PLAN"
    }
  ],
  "subscription": {
    "created_at": "2023-06-20T21:53:10Z",
    "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G",
    "id": "9ba40961-995a-4a3d-8c53-048c40cafc13",
    "location_id": "S8GWD5R9QB376",
    "phases": [
      {
        "order_template_id": "E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY",
        "ordinal": 0,
        "plan_phase_uid": "C66BKH3ASTDYGJJCEZXQQSS7",
        "uid": "98d6f53b-40e1-4714-8827-032fd923be25"
      }
    ],
    "plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7",
    "price_override_money": {
      "amount": 2000,
      "currency": "USD"
    },
    "source": {
      "name": "My Application"
    },
    "status": "ACTIVE",
    "timezone": "America/Los_Angeles",
    "version": 3
  }
}