Migrations
Migrates accounts which are associated to one price plan to another price plan
Migrates accounts which are associated to one price plan to another price plan
POST
/
migrations
/
price_plan
curl --request POST \
--url https://api.togai.com/migrations/price_plan \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"sourceId": "pp.1zYnCiM9Bpg.lv25y",
"sourceVersion": 1,
"targetId": "pp.2zYnCiM9Bpg.bfeu2",
"targetVersion": 2,
"migrationMode": "IMMEDIATE"
}'
{
"success": true
}
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
sourceId
string
requiredId of source price plan
sourceVersion
integer
requiredVersion of the source price plan
targetId
string
requiredId of target price plan
targetVersion
integer
requiredVersion of the target price plan
migrationMode
enum<string>
requiredAvailable options:
IMMEDIATE
, IMMEDIATE_IGNORE_OVERRIDE
, NEXT_CYCLE
, NEXT_CYCLE_IGNORE_OVERRIDE
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 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
Response
201 - application/json
success
boolean
requiredcurl --request POST \
--url https://api.togai.com/migrations/price_plan \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"sourceId": "pp.1zYnCiM9Bpg.lv25y",
"sourceVersion": 1,
"targetId": "pp.2zYnCiM9Bpg.bfeu2",
"targetVersion": 2,
"migrationMode": "IMMEDIATE"
}'
{
"success": true
}