Skip to main content
POST
Create migration

Authorizations

Authorization
string
header
required

API Keys can be issued in the Orb's web application.

Body

application/json
target_plan_version_number
integer
required

The plan version to migrate subscriptions to. It can't be a draft version.

effective_time
enum<string>
required

When the migration takes effect: 'immediately', 'requested_date' on effective_date, 'start_of_term' or 'end_of_term' for the start or end of each subscription's current billing period, or 'start_of_invoice' or 'end_of_invoice' for the start of its current or next invoice.

Available options:
immediately,
requested_date,
start_of_term,
end_of_term,
start_of_invoice,
end_of_invoice
plan_id
string | null

The plan whose subscriptions to migrate. Exactly one of plan_id and external_plan_id is required.

external_plan_id
string | null

The external ID of the plan whose subscriptions to migrate.

effective_date
string<date> | null

The date the migration takes effect, at midnight in each customer's timezone. Required when effective_time is requested_date, and not allowed otherwise.

included_subscription_ids
string[] | null

Migrate only these subscriptions. When set, the filters below are ignored.

Required array length: 1 - 250 elements
excluded_subscription_ids
string[] | null

Leave these subscriptions out. Can't be combined with included_subscription_ids.

Required array length: 1 - 250 elements
statuses
enum<string>[]

Migrate subscriptions with these statuses. Defaults to active subscriptions.

Minimum array length: 1
Available options:
active,
upcoming
plan_version_numbers
integer[] | null

Migrate only subscriptions currently on these plan versions.

Minimum array length: 1
in_trial
boolean | null

true migrates only subscriptions in a trial, false only subscriptions not in a trial.

allow_invoice_credit_or_void
boolean
default:true

When false, a subscription whose migration would void an issued invoice or create a credit note fails instead.

can_defer_billing
boolean
default:false

When true, an in-arrears price the migration ends mid-cycle bills its final line item on the next scheduled invoice instead of on its end date.

reason
string | null

Why the migration was created.

Maximum string length: 500

Response

Created

id
string
required

Unique identifier for this plan version change.

plan_id
string
required

The ID of the plan being migrated.

effective_time
required

When the migration takes effect. Can be a specific date/time, 'start_of_term' or 'end_of_term' when scheduled to be at the start or end of the current billing period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the start of the current or next invoice.

status
enum<string>
required

Current status of the migration: 'not_started', 'in_progress', 'completed', 'action_needed', or 'canceled'.

Available options:
not_started,
in_progress,
completed,
action_needed,
canceled
started_at
string<date-time> | null
required

When Orb began migrating the plan's subscriptions. Null if the migration has not begun, or was canceled before it began.

ended_at
string<date-time> | null
required

When the migration completed or was canceled, or null if it is still in progress.

target_plan_version_number
integer
required

The plan version subscriptions are migrated to.