customerPaymentMethodCreditCardUpdate mutation
Updates the credit card payment method for a customer.
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 customerPaymentMethodCreditCardUpdate($id: ID!, $billingAddress: MailingAddressInput!, $sessionId: String!) { customerPaymentMethodCreditCardUpdate(id: $id, billingAddress: $billingAddress, sessionId: $sessionId) {} } { “id”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=”, “billingAddress”: {}, “sessionId”: “placeholder” }
<font style="color:#1F61A0;">customerPaymentMethod</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">id</font>
<font style="color:#555555;">}</font>
<font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">field</font>
<font style="color:#1F61A0;">message</font>
<font style="color:#555555;">}</font>
Arguments
MailingAddressInput fields
- address1 (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The first line of the address. Typically the street address or PO Box number. - address2 (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The second line of the address. Typically the number of the apartment, suite, or unit. - city (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The name of the city, district, village, or town. - company (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The name of the customer’s company or organization. - country (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The name of the country. This argument is deprecated: UsecountryCode
instead. - countryCode (
[CountryCode](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/countrycode)
)
The two-letter code for the country of the address. - firstName (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The first name of the customer. - id (
[ID](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)
)
This argument is deprecated: Not needed for 90% of mutations, and provided separately where it is needed. - lastName (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The last name of the customer. - phone (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
A unique phone number for the customer.
Formatted using E.164 standard. For example, +16135551111. - province (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The region of the address, such as the province, state, or district. This argument is deprecated: UseprovinceCode
instead. - provinceCode (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The code for the region of the address, such as the province, state, or district. For example QC for Quebec, Canada. - zip (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The zip or postal code of the address.
Return fields
- customerPaymentMethod (
[CustomerPaymentMethod](https://shopify.dev/docs/admin-api/graphql/reference/customers/customerpaymentmethod)
)
The customer payment method. - userErrors (
[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror)
)
List of errors that occurred executing the mutation.