Troubleshooting migration errors

This article goes through a list of common errors you could receive while importing your Migration File. For general information, take a look at View migration file structure information.


Example Error

If any errors occur during validation or import, Ordergroove provides an error summary at the top level of the customer row object, along with more specific error details at the specific object's level.

For example:

[
...
  {
    "customer": {...}
    },
    "addresses": [...],
    "payments": [
      {
        "customer": "11112222334455",
        "live": true,
        "token_id": null,
        "billing_address": null,
        "public_id": null,
        "cc_number": null,
        "label": null,
        "cc_holder": null,
        "cc_type": null,
        "cc_exp_date": null,
        "payment_method": "credit card",
        "created": null,
        "last_updated": null,
        "origin": {
          "id": "payment-0",
          "billing_address": "billing",
          "payment_processor": {
            "type": null,
            "data": {
              "token": null
            }
          }
        },
        "error": {
          "token_id": [
            "This field is required",
            "Expecting a string"
          ],
          "origin": [
            "unknown origin.payment_processor.type; expected stripe, paypal or authorize"
          ]
        }
      }
    ],
    "subscriptions": [...],
    "errors": [
      "Payment validation errors"
    ]
  }
]

Potential Error Messages

Below, you'll find most of the error messages you may find for subscriptions that fail to import. Error types include, but are not limited to

Customer Object

Error Solution
merchant_user_id: Expecting string All emails must be formatted as user@domain.com
email: Missing @ sign
email: Multiple @ signs
email: Missing username
email: Domain needs to have a . sign in it
email: Empty string before "." in domain
email: Empty string after "." in domain

Address Object

Error Description Solution
address_type: Unsupported value. Expecting "shipping_address" or "billing_address" Your address object does not have a correctly formatted address type value Use either "shipping_address" or "billing_address" as the field value
country_code: Given country code is not supported You've provided an invalid country code or a country code to a country to which Ordergroove does not support shipping How To Resolve: You can see all of the countries that we accept here in Ordergroove look through your dataset and ensure you're not trying to ship to countries not on that list or an invalid 2 letter ISO country code
state_province_code: Given state/province code for given country is not supported You've provided an invalid state code for a country. We validate states using this data which is based on Google’s i18n address repository. Please check to ensure that the code provided matches what is in this data. 
phone: phone_number_validation_error - format is incorrect The phone number provided is either invalid or not in the correct format Please ensure that all phone numbers are in E.164 formatting. Often this just involves dropping leading 0s and adding + symbol.

Recharge Specific

Error Description Solution
'Untranslated country in billing address. Please change to 2 letter ISO code' The state and/or country code provided is either invalid or not in the correct format. We validate states using this data which is based on Google’s i18n address repository. Please check to ensure that the codes provided match what is in this data.
'Untranslated state/province in billing address. '
'Untranslated country in shipping address. Please change to 2 letter ISO code'
'Untranslated state/province in shipping address. '

Payment Object

Error Information Solution
cc_exp_date: Expecting string or null   You can set this field to optional in RC3 or update your dataset and/or transformation process to ensure you're sending this value as a string or null (eg not an integer).
cc_exp_date: Expecting MM/YYYY date format   You can set this field to optional in RC3 or update your dataset and/or transformation process to ensure you're sending this value in the expected format of MM/YYYY.
token: Missing stripe customer token There is no stripe token for the payment method which is required to create a subscription using that payment method. If the payment method is not used - remove it. Otherwise, you may need to look in Stripe's system or contact them (or Recharge) directly.
origin: Billing address does not exist You may see the following error, in the context of an Errors after an attempted import.
The ID of the billing address associated with this payment method has not been created and/or does not exist within the current customer's migration data.
Double-check IDs and addresses in your system. If correct but you can't find the correct IDs provide your own IDs as long as they're sure to be unique and connect the billing address to the payment method correctly.

 

If you're migrating to Shopify payments...

When migrating to Shopify payments, you may encounter the following error message(s) in the origin:

"payments": [
  ...
  {
    ...
    "origin": {
      "data": {
        ...
        "error": {
          "errorMessage": "[{\"code\":null,\"field\":null,\"message\":\"has already been taken\"}]",
          "getExistingPaymentError": "More than one payment already exist for customer. Cannot pick one"
        }
      }
    }
  }
]

This means that the provided payment token has already been migrated and the customer has more than one payment in Shopify available to choose from.

In order to provide a seamless customer experience, we want to make sure that the correct payment the customer expects is associated with their subscription(s). With that in mind, our system makes no assumptions as to which Shopify payment should be used when more than one exists. If there's only one in Shopify, we use it.

How to resolve

  1. Log in to your Shopify store
  2. Find the customer and view their details

In the best-case scenario, you'll see two payment methods that are identical. If that's the case then

  1. One can be deleted, and the other cannot
  2. Delete the one
  3. Rerun the import with the data you have in the file
  4. If a customer only has one payment method, we'll use it during the import process

Otherwise, if you find that

  • Neither identical payment method can be deleted or
  • The payment methods are different

Please open a ticket with us. We'll need you to tell us which payment method you want to use. This will allow us to  provide you with the Shopify payment token to populate the payment token_id field.


Subscription Object

Error Description Solution
Expecting string representing a decimal number In order to create a Shopify subscription contract you need to provide a price for the subscription. This price will not be used when charging the customer and currently is inconsequential to the operation of the subscription. Update the price on the subscription.
next_order_date:  This is a required field for live subscriptions This is required for both Shopify Subscription Contract creation as well as the Ordergoove import Please include this field in your import.
next_order_date: Expecting date string with format YYYY-MM-DD You supplied a date but not in our required format Please update this field to be in the following format: YYYY-MM-DD
next_order_date: Date is in the past This happens sometimes if the file hasn't been updated recently. Check your existing system to see what the next order date is currently.
If you've just done a dry run only, you can leave it as is. If the error file was created during a live migration run, you'll want to change the date in the error file to match the new date in your other system.
start_date: Expecting date string with format YYYY-MM-DD A date is present but not in our required format. Please update this field to be in the following format: YYYY-MM-DD.
canceled: Expecting date-time string with format YYYY-MM-DDThh:mm:ss A date is present but not in our required format. Please update this field to be in the following format: YYYY-MM-DDThh:mm:ss
origin: Shipping address does not exist The ID of the shipping address associated with this subscription has not been created and/or does not exist within the current customer's migration data. Double-check IDs and addresses in your system. If correct but you can't find the correct IDs provide your own IDs as long as they're sure to be unique and connect the shipping address to the subscription correctly.
origin: Payment does not exist The ID of the payment method associated with this subscription has not been created and/or does not exist within the current customer's migration data. Double-check IDs and addresses in your system. If correct but you can't find the correct IDs provide your own IDs as long as they're sure to be unique and connect the shipping address to the subscription correctly.

Multiple Subscriptions or Duplicated Data

Subscriptions may also return an error that pertains to some precautions we have in place to ensure data is not duplicated over multiple runs of data. More specifically, we will flag if a customer has two subscription records with the same values for the following fields:

  • product
  • every
  • every_period
  • shipping_address
  • payment
  • merchant_order_id

When this happens, the error file will populate an error field on the subscription record with the following message:

400 Client Error: Bad Request for url: https://api.ordergroove.com/program_migrations/migrate_subscription - Subscription XXXXXX already exists with this information

How do I determine if the subscription is legitimate or a duplicate?

Short of asking the customer, you should look at the customer record in the migration file and then look at the list of subscriptions.

In the simplest case, there's only one subscription object for the customer. This indicates that a retry mechanism was triggered in the import process but was retrying a failure on the client side that was successful on the server side.

If, however, you find one or more subscription objects in the customer row with matching fields as listed above, you'll need to determine if there was duplication during the extraction of the data or the construction of the data set.

If you find no such duplication occurred, please see below how to bypass our duplication check.

How do I bypass the duplicate checks if the subscription is in fact legitimate?

If you determine that this is in fact legitimate, not a duplicate, and should be imported, then the recommended course of action is to modify the merchant_order_id field. Because it's a string, you can modify it any way you like.


Broader Scope Error Messages

In some instances, there will be some network errors that occur during the migration. These will manifest with an error message indicating

  • Timeout occurred while making a request
  • Internal server error
  • field: Expecting string
  • field: Whitespaces are not allowed

For Timeout errors, you don't need to make any modifications to that particular object. Simply rerunning the import should be enough

If you see Internal server error, you can attempt to rerun the data as is, however, it is recommend that you please open a ticket with us if this error persists.