Hi.
I’m working on a headless store, using both Admin and Storefront GraphQL APIs.
We are trying to allow customers to add/remove/update payment cards, so they can update payment method on subscription orders.
So basically what we want to do is:
- Show a list of existing payment methods attached to the account (not the store ones)
- We already list the user subscription orders (using Loop), so we will add a dropdown on the subscription detail, that way customer can choose what the new payment method associated with the subscription is. See
What I have found:
- You can retrieve customer payment methods using this query, which requires read_customer_payment_methods
- New payment methods can be added with this mutation
The problem is that
- Looks like read_customer_payment_methods is only available for Apps, can some one confirm this?
- The documentation isn’t clear enough on how to use the customerPaymentMethodCreditCardCreate which makes it very hard to implement, it says:
The Cardserver session ID. Obtained by storing card data with Shopify’s Cardsink. Exchanging raw card data for a session ID must be done in a PCI complaint environment. - Which is not really helpful
Can some one explain how to properly retrieve customer’s payment method on regular GraphQL Admin API without having to create an App?
Also how to add new payment methods, using Shopify’s Cardsink (whatever this is)?