Imported customer payment methods from Stripe are null

Hi -

We’ve got 2 Shopify Plus customers that are migrating from an external platform on to Shopify and bringing along their subscriptions. We’re trying to get their payment methods over to Shopify from Stripe but the payment methods don’t seem to be getting generated. We’ve run this exact same kind of migration over a hundred times but I’ve not seen this before. I understand that payment methods are generated asynchronously and I am looking for the payment method some time after the call to the customerPaymentMethodRemoteCreate mutation but the generated customer payment methods are always returning null when I try to fetch them.


Some facts:

  • I’ve confirmed that the correct Stripe account is connected as a legacy gateway on both shops
  • I’ve confirmed the shops are both using Shopify Payments and are not in test mode
  • I’ve tested customerPaymentMethodRemoteCreate on multiple customers on both shops and repeated the tests three days in a row
  • I’ve tried creating a test customer in Stripe and in Shopify and added a payment method to the customer in Stripe to test importing that into Shopify and it fails in the exact same way

Shops that I’m currently seeing this issue on

  • gid://shopify/Shop/57686229067
  • gid://shopify/Shop/69378867447

Sample Requests First Shop
x-request-id of remote create mutation for first shop (57686229067): 540e7416-e089-45e5-8d65-b76028abe557-1736334739
…and that returned a payment method id: gid://shopify/CustomerPaymentMethod/d23e13d3b976ea209c97fbbd3752c922 which returns null when you try to fetch it and you can see that the customer (gid://shopify/Customer/7948843384907) has no payment methods connected


Sample Requests Second Shop
x-request-id of remote create mutation for second shop (69378867447): d3f33be5-6629-4c1d-8352-35449bcfa833-1736334591
…and that returned a payment method id: gid://shopify/CustomerPaymentMethod/fbe2994fa3127be62365882175ad9f3e which returns null when you try to fetch it and you can see that the customer (gid://shopify/Customer/7589730943223) has no payment methods connected


Any guidance would be appreciated as its blocking these Shopify Plus merchants from getting moved over to Shopify.

Thank you!

For anybody having this issue - it turns out that there’s now validation on Stripe payment methods’ billing address. If the billing address doesn’t exist your payment method creation will not work.

Looks like in the current unstable version of the API there’s a way to disable that validation but I know that often if you import a payment method from Stripe with no billing address you’ll end up with a sub whose billing attempts always fail. I guess this new validation on the payment method creation is to get around that issue.

We were able to fix the issue by adding billing addresses to the cards in Stripe before importing to Shopify

1 Like

Hey Brian,

Glad you figured this out and thanks for coming back here to update!

Hi Brian,
When trying this API I also get null in response even I’ve set billing address for the Stripe payment method. Have you experienced on this issue? I’m using Stripe with Test mode. Could it be the reason?

I’m assuming you’re trying to fetch the payment methods after the ID is provided to confirm its actually null, correct? If not do that

But yes - I also believe stripe in test mode will make this not work

Yes, in my test, I’ve created new customer payment method from these data

const customerId = "gid://shopify/Customer/7315629408337";
const paymentMethodId = "pm_1RNo6aAzGox319XKBf1kGbW7";
const stripeCustomerId = 'cus_SIO9G7Z6tMrhDw';

and then grab the method id return and fetch the method for 10 times with interval 1 second but they are all null.

I think the document should be more details for null situations.
At the moment I can only think of the case is the Stripe is in test mode. But I’m doing tests so I don’t want to use it in live mode.

Yea - Shopify is using Stripe’s API but they don’t know that you want to use the Stripe API in test mode. So they always use it in production mode which wont work on an account in test mode.

Hi Brian,
It was just my guess. After switch to live mode (using live API key to create stripe customer & payment method), I’ve still got null in response.

I don’t know if there’s any issue with the billing address or not (I’m using a random address picked from google maps for testing). Here is the payment method details, hope you guys can find out something wrong with it…

{
    "id": "pm_1RO9kBAz......Qzcq1",
    "object": "payment_method",
    "allow_redisplay": "unspecified",
    "billing_details": {
      "address": {
        "city": "Escondido",
        "country": "US",
        "line1": "610 Rock Springs Rd",
        "line2": "",
        "postal_code": "92025",
        "state": "California"
      },
      "email": "baochungit@gmail.com",
      "name": "Chung Xa",
      "phone": null,
      "tax_id": null
    },
    "card": {
      "brand": "visa",
      "checks": {
        "address_line1_check": "unavailable",
        "address_postal_code_check": "unavailable",
        "cvc_check": "pass"
      },
      "country": "VN",
      "display_brand": "visa",
      "exp_month": 8,
      "exp_year": 2029,
      "fingerprint": "0G16UUChKCZZsuRx",
      "funding": "credit",
      "generated_from": null,
      "last4": "8666",
      "networks": {
        "available": [
          "visa"
        ],
        "preferred": null
      },
      "regulated_status": "unregulated",
      "three_d_secure_usage": {
        "supported": true
      },
      "wallet": null
    },
    "created": 1747107783,
    "customer": "cus_SIkv......rDi7Oq",
    "livemode": true,
    "metadata": {},
    "radar_options": {},
    "type": "card"
  }

One thing I can guess is that I’m not using Shopify Plus for the store. Can it be the case?

No it’s not just for plus. Have you connected stripe as a legacy gateway?

Thanks Brian,
that should be the case..

I’m using Bogus (for testing) gateway, but I don’t see Stripe gateway in the provider list. Is it a part of Shopify Payments?

I dont think this will work w bogus gateway. You need shopify payments set up. I’d recommend reading this guide thoroughly: https://shopify.dev/docs/apps/build/purchase-options/subscriptions/migrate-to-subscriptions-api/migrate-customer-information

1 Like