Help creating a customer payment method

Solved
KTNinja
Shopify Partner
19 1 2

Hello, I'm trying to use the Customer Payment Method API (https://shopify.dev/docs/admin-api/graphql/reference/customers/customerpaymentmethod) to create a Payment Method for a Shopify Customer

I'm having some trouble with the "sessionId" input to this customerPaymentMethodCreditCardCreate mutation takes (https://shopify.dev/docs/admin-api/graphql/reference/customers/customerpaymentmethodcreditcardcreate)

Any help or guidance on this would be great, thanks!

Accepted Solution (1)
yalshekerchi
Shopify Staff
Shopify Staff
13 4 4

This is an accepted solution.

Hello,

Thank you for you question!

The "sessionId" parameter can be obtained by creating a payment session where the card details are submitted to Shopify's card vault in exchange for a session ID.

You can find out more about creating a payment session on the Payment API page here: https://shopify.dev/docs/admin-api/rest/reference/sales-channels/payment

View solution in original post

Replies 5 (5)
KTNinja
Shopify Partner
19 1 2

Nevermind, figured it out

For anyone having trouble getting a valid sessionId, refer to https://shopify.dev/docs/admin-api/rest/reference/sales-channels/payment#create_payment_session-2021...

yalshekerchi
Shopify Staff
Shopify Staff
13 4 4

This is an accepted solution.

Hello,

Thank you for you question!

The "sessionId" parameter can be obtained by creating a payment session where the card details are submitted to Shopify's card vault in exchange for a session ID.

You can find out more about creating a payment session on the Payment API page here: https://shopify.dev/docs/admin-api/rest/reference/sales-channels/payment

KTNinja
Shopify Partner
19 1 2

Thanks @yalshekerchi for the response, stumbled upon the same page just a little while ago too and was able to create a payment method for the customer!

TravisSTT
New Member
8 0 0

Thank you for sharing

Elsolidbando
New Member
1 0 0

First sell and receiving payments