Custom Platform

This article is written specifically to cater to migration from subscription solutions that are outside of the Shopify ecosystem (or) are partially managed within Shopify


Types of custom platforms

Custom platforms / implementations vary greatly from one case to another and would fall under two basic categories.

  1. Subscription Management through Payment Provider

    1. Stripe → https://stripe.com/docs/billing/subscriptions/overview

    2. Braintree → https://developer.paypal.com/braintree/docs/guides/recurring-billing/overview

    3. Authorize → https://developer.authorize.net/api/reference/features/recurring-billing.html

  2. Subscription Management using vaulted payments
    In this method the subscription management is separated from the PSP and the implementation would be designed to place a charge on the vaulted token stored in the PSP.

The type of custom platform would define where to fetch the data required for step 3 of the migration phase Subscription Migration


Migration steps and Phases

When shifting from a custom platform there are usually three distinct phases, and a brief overview is provided for each stage before delving into the detailed specifics of each stage

Phase

Description

Items covered

Migrating Customers (and/or) Order information

The personal information is imported into Shopify using the inbuilt / external tools. The information includes previous order history, email, addresses and other PII

Customer accounts, Addresses, Email, Order History

Migrating Payments

Customer’s card / payment information is imported into Shopify’s vault for supported payment providers

Payment Token / Card details

Migrating Subscriptions

The subscription contracts from your source platform will be recreated within Loop and new billings will be processed by Loop system

Subscription Contract

Migrating Customers and Order information → This phase is optional and only required if the merchant is migrating from a custom platform outside the Shopify ecosystem


Migrating Customers (and/or) Order information

This step is optional and would not be required for platforms that are partly integrated / built on top of Shopify as custom apps / solutions as in these cases the customer profile would already be present with Shopify.

Here is a quick visualisation of the most important objects / elements that are usually present for each customer object, In this first phase the aim is to import the Personally Identifiable info into the platform

graph TD     
Customer  --> Address     
Customer  --> Orders     
Customer  --> PaymentInformation     
Customer  --> SubscriptionContracts 

This phase will cover these two sections and important guides / links are provided below for reference

  1. Customer Import

    1. Address

    2. Email

    3. Contact details

    4. Other information

  2. Order Import

    1. Order value

    2. Line items

    3. Address used for order

    4. Discount information

Shopify provides an inbuilt tool to import customers from a CSV and is detailed in depth in this article

Order Import is usually handled by platforms / apps like EZ-Importer, Matrixify etc


Migrating Payments

Migrating Payment from your old platform consists of the following steps and the flowchart would be able to give the merchant a good understanding of the entire process of importing payments into Shopify.

graph TD
    A[Check for supported payment provider]
    A -- Not supported --> B[Migrate from current PSP to supported provider]
    B -- After migration --> C[Connect PSP as secondary/primary provider]
    A -- Supported --> C
    C -- Import tokens --> D[Shopify's vault]
    D -- Store and sync --> E[Shopify tokens in Loop's DB]

Important note and warning →

In case of using the ideal setup (Shopify Payments primary + Secondary provider (stripe/braintree/authorize))

If your previous subscription platform / custom solution was leveraging two supported PSP’s eg, Braintree and Stripe - then it would be required to have all the payment tokens imported into one supported provider before the payment method import into Shopify vault

This is because only one secondary provider can be connected in Shopify at any point.


Check if your Payment Provider is Supported by Shopify for Subscriptions

To be able to import payments into Shopify - you would need to use one of the supported payment providers that are mentioned in this document detailed by Shopify. Exhaustive documentation is provided in Shopify’s developer documentation.

  1. Braintree (can only be used as secondary)

  2. Stripe (can also be used as sole primary gateway)

  3. Authorize (can also be used as sole primary gateway)

  4. PayPal Express (can be used separately without any interferance from the primary and secondary gateways)

 graph TD
    subgraph SecondaryProviders
        Braintree
        Stripe
        Authorize
        PayPal_Express
    end

    subgraph PrimaryProviders
        ShopifyPayments
    end

    Shopify --> SecondaryProviders
    Shopify --> PrimaryProviders

Shopify Payments does not support importing / exporting tokens (payment information) in/out of their solution. But it does allow you to connect one secondary provider to your store to process subscriptions.

When importing from braintree - Shopify only supports importing credit cards and Apple Pay payment methods from Braintree. Migrating PayPal, Google Pay, and other payment methods isn't supported


When braintree is set as primary - the checkout does not support subscription purchase type. Hence braintree can only be used as a secondary provider


How does an ideal payment setup look like in Shopify when migrating into the ecosystem.

An ideal setup would be to use Shopify Payments as your main PSP with either Braintree / Stripe as your secondary for processing your subscription renewals. As this way you can leverage the cheaper txn charges offered by Shopify Payments while being able to import and charge your old subscriptions in Shopify

Shopify Payments + Braintree (or) Shopify Payments + Stripe (or) Shopify Payments + Authorize

PayPal Express does not count as a payment provider in Shopify and hence can be used along with any of the above mentioned setups

Note that the ideal setup described here is an example taking into the costings of each provider and the advantages that Shopify Payments brings to the table. Your exact siutation might vary based on the pricing agreement with your provider.


How to connect a secondary payment provider in Shopify ?

To connect Stripe / Braintree as a secondary provider in your Shopify account, simply follow the below steps.

  1. Head over to Loop > Settings > Migrate customers and payment methods

  2. Choose the Payment provider that you want to connect as secondary and click on the green Connect button

  3. This will take you to an Oauth Page like shown below, enter your credentials to login

  4. If you have more than one account - choose the same account that is connected to your old platform / store


How do i import the tokens into Shopify?

Prerequisite →

To start this step - it is required that the PSP that you are importing tokens from would need to be connected to your Shopify account as a primary / secondary provider.

If all the prerequisites are met - then the merchant can share the export and API token from the PSP that loop team can use to import these PSP tokens into Shopify to create something called RemoteCreditCard

What needs to be shared with Loop team →

  1. Customer Export from Payment Provider

    1. Stripe

    2. Authorize

    3. Braintree

  2. API token from Payment Provider

    1. Stripe

    2. Authorize → to get name and txn key [guide]

      1. name → Merchant’s unique API Login ID.

      2. transactionKey → Merchant’s unique Transaction Key.

    3. Braintree

      1. merchant_id

      2. public_key

      3. private_key

Loop team will perform the import process once the respective exports and API tokens are shared with the migrations team.

How the process looks like on Loop’s side

  1. Loop team will convert the customer data export from the PSP to standard format supported by Loop

  2. We will then hit the following endpoint POST /admin/api/2023-07/graphql.json with the CustomerPaymentMethodRemoteCreate mutation

  3. The response is then stored and reverse mapped with the input data to provide a 1:1 mapping between the source tokens and the shopify unique gid’s

Standard Payment Import format on Loop →


Verification of Payment Method Import

Once the payment tokens have been successfully imported by the team you should be able to see it in shopify under the customer object as shown in the below screenshot for every card that was imported as part of this process.


Migrate Subscriptions

The source for fetching information would depend on the type of custom solution that your platform / deployment uses

The flowchart below details how the overall subscription migration process would look like and gives an end to end perspective on the stages in this process.

graph TD
    A[Step 1: Check conditions]
    A -- Subscription Management through Payment Provider --> B[Fetch subscription data from PSP or custom solution]
    B --> C[Convert data to Loop migration template]
    C --> D[Share data with Loop team]
    D --> E[Loop migration team recreates subscriptions]
    E --> F[Loop migration team shares detailed report with merchant]
    A -- Subscription Management using vaulted payments --> G[Fetch subscription data from custom platform / solution]
    G --> C

Check for type of custom platform

Since there is a vast difference in how the data is handled between the types of platforms explained here, merchant can decide their source of truth to fetch subscription information from.

  1. Usually when Subscription Management through Payment Provider - the information related to cadence, address and line item information are present directly on the PSP itself. But this depends on how your solution has implemented / made use of the PSP APIs.

  2. When the custom platform uses vaulted payments - only the payment related information resides in the PSP and not much more. The platform leverages the PSP only for charges and the source of data would be the custom platform itself.


Convert data to Loop migration template and share with Loop team

We provide a standard subscription migration template which would need to be filled in by the merchant’s team with the data that we can use to import the contracts to Loop.

This sheet provides a good understanding of all the fields and the formats that we would need for the migration →

Once this data is prepared from the merchant’s side → they can send this across to the migration team at Loop via this email, migrations@loopwork.co


Internal migration process and Report

We have developed internal systems that make use of Shopify GraphQL APIs to create subscriptions in Loop with the data from the standard template. These endpoints are not exposed to the public and is only available for internal use as of now.

The core implementation that we have used is documented by Shopify themselves in this article and these are the same mutations and steps that we use for the migration internally as well.

Here is the detailed report format that we share to our merchants →

The statistics is grouped first on the MIGRATION STATUS and then grouped by status and the numbers are on the third column

  1. MIG STATUS → can be two states COMPLETE / FAILED

  2. status → can be one of four states ACTIVE / CANCELLED / PAUSED / EXPIRED

  3. COUNTA of platform_subscription_id → is a countunique(platform_subscription_id)

MIG STATUS

status

COUNT of platform_subscription_id

COMPLETE

ACTIVE

103

CANCELLED

38

PAUSED

3

COMPLETE Total

144

Grand Total

144

The detailed export contains the following fields →

  1. All the fields that are present in the Subscription Migration Format

  2. ERR → field shows the error that was encountered while importing sub to Loop

  3. MIG STATUS → Subscription level migration status

  4. LOOP SUB ID → Subscription contract ID in Loop for the migrated subscription