Skip to navigation

Create a migration

Creates a draft migration. Nothing is binding until you commit it.

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Headers

Paid-BetaenumRequired

This endpoint is in the migrations=v1 beta. Send this header to use it.

Allowed values:

Request

Body
ordersobjectRequired

Which orders move: those an include target matches, minus those an exclude target matches.

pricingobjectRequired

The pricing object whose orders move: a rate card or a price. More types may be added.

timingobjectRequired

When an order moves to the target version: immediate, date, nextBillingPeriod or earliestAllowed. More types may be added.

toVersionintegerRequired

The version of pricing that orders move to. Every selected order is on an earlier version; a migration only goes forward.

choiceslist of objectsOptional
Up to 1000 keep or drop choices for negotiated pricing entries. Commit needs a choice for every entry of every selected order, from a default or for the order. An update replaces the whole list.
invoiceTimingenumOptional

How a move partway through a billing period is billed. nextScheduledInvoice: the charges before and after the move go on the order’s next scheduled invoice, so the customer gets one invoice for the period. atChange: Paid invoices the charges up to the move when the order moves. A move at the start of a billing period bills the same either way. More values may be added.

Allowed values:
metadatamap from strings to stringsOptional

String key-value pairs of your own, up to 500 characters per value. Always updatable.

namestringOptional1-255 characters
An internal label for the migration. Your customers never see it.
orderTimingslist of objectsOptional

Up to 1000 timings for single orders, in place of timing. An update replaces the whole list.

Response

201
idstring
The migration's ID.
objectenum

The type of object. Always migration.

Allowed values:
createdAtdatetime
When the object was created.
choiceslist of objects
Up to 1000 keep or drop choices for negotiated pricing entries. Commit needs a choice for every entry of every selected order, from a default or for the order. An update replaces the whole list.
committedAtdatetime or null
When the migration was committed, or null while it is a draft.
invoiceTimingenum

How a move partway through a billing period is billed. nextScheduledInvoice: the charges before and after the move go on the order’s next scheduled invoice, so the customer gets one invoice for the period. atChange: Paid invoices the charges up to the move when the order moves. A move at the start of a billing period bills the same either way. More values may be added.

Allowed values:
livemodeboolean

true for an object on a live account, false on a test account.

metadatamap from strings to strings

String key-value pairs of your own, up to 500 characters per value. Always updatable.

namestring or null1-255 characters
An internal label for the migration. Your customers never see it. Null when none was set.
ordersobject

Which orders move: those an include target matches, minus those an exclude target matches.

orderTimingslist of objects

Up to 1000 timings for single orders, in place of timing. An update replaces the whole list.

pricingobject

The pricing object whose orders move: a rate card or a price. More types may be added.

revisioninteger

The number of the draft’s latest edit. Every update or restore adds one, and so does a change in what the draft would do, such as an order changing under a migration.

statusenum

Where the change is in its lifecycle. After commit, it follows from the change’s dates. draft: being prepared; nothing is binding yet. scheduled: committed, and waiting for its startsAt. inEffect: committed, and its startsAt has passed. completed: every part of it has taken effect. canceled: withdrawn before it took effect. More statuses may be added.

Allowed values:
timingobject

When an order moves to the target version: immediate, date, nextBillingPeriod or earliestAllowed. More types may be added.

toVersioninteger

The version of pricing that orders move to. Every selected order is on an earlier version; a migration only goes forward.

updatedAtdatetime
When the object was last changed.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error