Subscription Products

Preview Subscription Product Migration

POST
/subscriptions/{subscription_id}/migrations/preview.json

Previews the charges resulting from migrating a subscription to a different product.

Previewing a future date

It is also possible to preview the migration for a date in the future, as long as it's still within the subscription's current billing period, by passing a proration_date along with the request (e.g., "proration_date": "2020-12-18T18:25:43.511Z").

This will calculate the prorated adjustment, charge, payment and credit applied values assuming the migration is done at that date in the future as opposed to right now.

Authorization

BasicAuth
AuthorizationBasic <token>

The username is a Maxio Chargify API key. The password is x.

In: header

Path Parameters

subscription_id*integer

The Chargify id of the subscription.

Request Body

application/json

migration*

Response Body

application/json

application/json

curl -X POST "https://example.com/subscriptions/0/migrations/preview.json" \  -H "Content-Type: application/json" \  -d '{    "migration": {}  }'
{  "migration": {    "prorated_adjustment_in_cents": 0,    "charge_in_cents": 5000,    "payment_due_in_cents": 0,    "credit_applied_in_cents": 0  }}

Migrate Subscription Product POST

Migrates a subscription to a different product. To create a migration, you must pass the `product_id` or `product_handle` in the object when you send a POST request. You can also pass either a `product_price_point_id` or `product_price_point_handle` to choose which price point the subscription is moved to. If no price point identifier is passed, the subscription is moved to the product's default price point. The response is the updated subscription. ## Valid Subscriptions Subscriptions should be in the `active` or `trialing` state to be migrated. (For backwards compatibility reasons, it is possible to migrate a subscription that is in the `trial_ended` state via the API, however this is not recommended. Since `trial_ended` is an end-of-life state, the subscription should be canceled, the product changed, and then the subscription can be reactivated.) For more information, see [Product Changes and Migrations](https://docs.maxio.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations). ## Failed Migrations Important note: One of the most common ways that a migration can fail is when the attempt is made to migrate a subscription to its current product. ## 3D Secure (3DS) Authentication post-authentication flow When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow.

List Scheduled Renewals GET

Lists scheduled renewal configurations for the subscription and permits an optional status query filter.