---
title: "Create a price plan migration"
method: POST
path: "/price_plans/migration"
tags: ["Price Plans"]
---

# Create a price plan migration

`POST /price_plans/migration`

Migrates accounts across price plans. This is an asynchronous process functioning on top of Togai's Jobs 
framework. Status of the created migrations can be obtained using the [Jobs APIs](https://docs.togai.com/api-reference/jobs/get-the-status-of-a-job)

## Request body

- CreatePricePlanMigrationRequest — Migrate all account associations of a price plan to another price plan
  - `sourceId` string, required — Id of source price plan
  - `sourceVersion` integer, required — Version of the source price plan
  - `targetId` string — Id of target price plan
  - `targetVersion` integer — Version of the target price plan
  - `migrationMode` 'IMMEDIATE' | 'IMMEDIATE_IGNORE_OVERRIDE' | 'NEXT_CYCLE' | 'NEXT_CYCLE_IGNORE_OVERRIDE', required
  - `retainStartOffsets` boolean — If this flag is true, current pricing cycle of the account on the date of association will continue rather than the configurations of the newly associated price plan. Pricing cycle overrides specified using `pricePlanDetailsOverride` will take precedence over the pricing cycle configurations of the new price plan that the account needs to migrate to. PricingCycleInterval of the existing plan and the new plan must be same for this to work. We'll return a `400 BadRequest` otherwise. Examples: - Ongoing plan (1st Oct to 30th Oct) - {dayOffset: 1, monthOffset: NIL} New association (15th Oct to 15th Nov) of different price plan with retainStartOffsets option true will use the same pricing cycle configuration {dayOffset: 1, monthOffset: NIL} rather than using the pricing cycle configuration of the new price plan that the account needs to migrate to. - Ongoing plan (1st Oct to 30th Oct) - {dayOffset: 1, monthOffset: NIL} New association (1st Nov to 30th Nov) of different price plan with retainStartOffsets option true will throw a `400 BadRequest` as no existing price plan configuration found on date of association
  - `requireConfirmation` boolean — This field specifies whether to process job or to wait till the job is confirmed. Default value: false

## Response `201`

OK

- BaseSuccessResponse
  - `success` boolean, required

## Other responses

- `400` — Error response
- `401` — Error response
- `403` — Error response
- `404` — Error response
- `429` — Error response
- `default` — Error response

---

[API](https://skmtc.net/togaihq/apis/togai-apis.md) · [All operations](https://skmtc.net/togaihq/apis/togai-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/togaihq/togai-apis/revisions/442f5d8f4aa0/schema)
