Recharge Legacy / Native - Migration

This article will walk you through the complete migration process that is taken by Loop team and ensures a smooth ad

Prerequisites on Loop

  • Selling plan needs to be setup on the loop app

  • Loop widget should be live on the storefront to allow for capturing new subscriptions on loop

  • Customer account activation email notification should be disabled on Loop (and/or) any integration


Prerequisites

  • Recharge widget needs to be disabled on the storefront and the widget needs to be in the unpublished state

  • Subscription plan is unmapped in Recharge

  • Customer actions are disabled on Recharge

  • Customer Notifications are disabled on Recharge

  • Access to Recharge customer portal is disabled from storefront and other places (if applicable)

  • Loop team has access to API and reports on Recharge

  • Webhooks (if present) need to be disconnected on Recharge 


Preparing the migration data 

Data preparation for the migration process from Loop is done in two stages to collate different data points in each stage of the process

  1. Subscription Data from Recharge Reports

  2. Payment Method Data from Recharge API


Exporting data from Recharge reports

We leverage the exports functionality built into recharge to build the data that is required for migration on loop. The following exports are taken from Recharge for this purpose

  1. Customers - Shipping Addresses

  2. Customers

  3. ​​Subscriptions - All

  4. Charges - Queued

  5. Orders - Processed (from the first created_at date from Recharge)

During migration we take into account the following data fields from Recharge and this is how the standard template for migration looks like on Loop


Querying Recharge API 

Payment method ID is unique to each address ID that is present on Recharge, hence we ping the following endpoint from Recharge using addressId

-> https://developer.rechargepayments.com/2021-11/addresses/retrieve_address

This provides us with the payment_method_id which we use to query the payment details on the following endpoint on Recharge 

-> https://developer.rechargepayments.com/2021-11/payment_methods/payment_methods_retrieve


Migration

Migrating from Recharge is a two-step process 

  1. Migrating payments 

  2. Migrating subscriptions


Migrating payments 

Once the required data is obtained from Recharge using the Recharge API, we import these payments into Shopify using our this route and our internal tools. Once imported each payment method is given a unique token in Shopify which is of the following format

gid://shopify/CustomerPaymentMethod/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

This payment method token thus obtained is then reverse mapped to the subscription contract on the basis of the addressId.

If you used to have more than one PSP mapped to Recharge in the past - then there might be a requirement to migrate the tokens from one of the two providers into the other.

This is because Shopify only allows us to have one secondary PSP connected to Shopify at any point of time.

If you are on Recharge Native - this step will be skipped as the payment tokens reside in Shopify itself and not within the Payment provider as is the case with Recharge Legacy system.


Migrating subscriptions

The data that is prepared in the export stage is then migrated into Loop using internal tools along with the payment method details that were obtained and imported from the previous step.

Recharge subscriptions that are present in the active state, but without a valid charge, are marked as Active with a next charge date set to the end of the current month before importing into loop.

Note →

Although we can obtain discount codes from Recharge through their API - we will need to recreate the discounts in Shopify to be able to import them as part of the subscription import process


Post Migration

After the subscriptions are successfully migrated to Loop we can leverage two methods to cancel subscriptions on Recharge based on availability

  1. Cancel using bulk actions 

  2. Cancel using API

The preferred method is to use API to cancel the subscriptions in Recharge. This allows us to cancel the subscriptions as they are migrated successfully to Loop.


Cancel using bulk actions

If the feature is available for use on the platform, then we can leverage the bulk status update functionality to run a bulk cancel action on the app

>https://support.rechargepayments.com/hc/en-us/articles/4414137334295

>https://support.rechargepayments.com/hc/en-us/articles/360008828973-Pause-cancel-or-delete-a-subscription#h_01F6QW6K1CH72A1KQF5ZMRM4VQ


Cancel using API

Else if the feature is unavailable due to any reason we can then use the API endpoint to cancel the subscriptions en masse on recharge. 

> https://developer.rechargepayments.com/2021-11/subscriptions/subscriptions_cancel