For discussing the development and integration of subscription-enabled shops using Shopify's Subscription APIs.
We are providing the subscription app on Shopify App Store.
We called Subscription's BillingAttempt API at 2021-10-06 12:00 (UTC).
Ref: https://shopify.dev/api/admin-graphql/2021-07/mutations/subscriptionBillingAttemptCreate
The response's error_code was "unexpected_error" and error_message was "No such customer: 'card_xxxxxxxxxxxxxxxx'". What is the error?
Also, The customer has a payment method. The payment method is integrated with Stripe by customerPaymentMethodRemoteCreditCardCreate mutation API.
Ref: https://shopify.dev/api/admin-graphql/2021-10/mutations/customerpaymentmethodremotecreditcardcreate
Thanks,
Solved! Go to the solution
This is an accepted solution.
@camelmasa Correct, you need to call Revoke first.
And when you call Revoke, there will be an error that there's active subscription associated with this payment method.
If it's test subscription, you can just cancel it. If it is actual customer's subscription, then you would need something like that:
For steps 1,4,5 you will need combination of these mutations:
https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptioncontractupdate
https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptionDraftUpdate
https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptionDraftCommit
Observing the very similar problem here: https://community.shopify.com/c/shopify-apis-and-sdks/stripe-payment-method-from-customerpaymentmeth...
So, this is widespread.
Shopify Support, please, address ASAP.
@camelmasa, we've received a reply from Justin B from Shopify Developer Support:
Just letting you know the issue was identified and a fix was just deployed. The fix has restored the previous behaviour for this mutation by allowing it to be sent with only the StripeCustomerId and customerId arguments. It will also ensure any payment methods created with this mutation moving forward are valid and able to process billing attempts.
So, if you try to re-create the payment method now, it should work. We were using this mutation passing only customerId (Shopify's) and stripeCustomerId, and it was creating correct payment methods.
Good luck!
Awesome! Thank you for sharing the information. I'll try that!
@vladimird Did you try that ? Did you receive a "has already been taken" error when calling customerPaymentMethodRemoteCreditCardCreate mutation API?
Should I call customerPaymentMethodRevoke mutation API first?
https://shopify.dev/api/admin-graphql/2021-10/mutations/customerPaymentMethodRevoke
This is an accepted solution.
@camelmasa Correct, you need to call Revoke first.
And when you call Revoke, there will be an error that there's active subscription associated with this payment method.
If it's test subscription, you can just cancel it. If it is actual customer's subscription, then you would need something like that:
For steps 1,4,5 you will need combination of these mutations:
https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptioncontractupdate
https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptionDraftUpdate
https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptionDraftCommit
Oh my gosh! Thank you for your kindness!