customerPaymentMethodRemoteCreditCardCreate mutation

Create a payment method from a credit card stored by Stripe.

Required access

write_customers access scope.


On this page


Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.

mutation customerPaymentMethodRemoteCreditCardCreate($customerId: ID!, $stripeCustomerId: String!) { customerPaymentMethodRemoteCreditCardCreate(customerId: $customerId, stripeCustomerId: $stripeCustomerId) {
  1. <font style="color:#1F61A0;">customerPaymentMethod</font> <font style="color:#555555;">{</font>
  2. <font style="color:#1F61A0;">id</font>
  3. <font style="color:#555555;">}</font>
  4. <font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
  5. <font style="color:#1F61A0;">code</font>
  6. <font style="color:#1F61A0;">field</font>
  7. <font style="color:#1F61A0;">message</font>
  8. <font style="color:#555555;">}</font>
} } { “customerId”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=”, “stripeCustomerId”: “placeholder” }


Arguments

Argument Description
customerId
(
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)

) REQUIRED
The ID of the customer.
stripeCustomerId
(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

) REQUIRED
The Stripe Customer ID.
stripePaymentMethodId
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
The Stripe Payment Method ID.


Return fields

  • customerPaymentMethod ([CustomerPaymentMethod](https://shopify.dev/docs/admin-api/graphql/reference/customers/customerpaymentmethod))
    The customer payment method.
  • userErrors ([[CustomerPaymentMethodUserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/customers/customerpaymentmethodusererror))
    List of errors that occurred executing the mutation.