Anchor to customerPaymentMethodSendUpdateEmailcustomer
customer Payment Method Send Update Email
mutation
Requires access scope.
Sends a link to the customer so they can update a specific payment method.
Anchor to Arguments
Arguments
- Anchor to customerPaymentMethodIdcustomer•
Payment Method Id ID!required The payment method to be updated.
- Anchor to emailemail•
Specifies the payment method update email fields. Only the 'from' and 'bcc' fields are accepted for input.
Was this section helpful?
Anchor to CustomerPaymentMethodSendUpdateEmailPayload returnsCustomer Payment Method Send Update Email Payload returns
- Anchor to customercustomer•
The customer to whom an update payment method email was sent.
- Anchor to userErrorsuser•
Errors [UserError!]!non-null The list of errors that occurred from executing the mutation.
Was this section helpful?
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 mutation sendCustomerPaymentUpdateEmail($customerPaymentMethodId: ID!) {6 customerPaymentMethodSendUpdateEmail(customerPaymentMethodId: $customerPaymentMethodId) {7 customer {8 id9 }10 userErrors {11 field12 message13 }14 }15 }`,16 {17 variables: {18 "customerPaymentMethodId": "gid://shopify/CustomerPaymentMethod/b7cc6e3267aace169e516ed48be72dff"19 },20 },21);2223const data = await response.json();24
mutation sendCustomerPaymentUpdateEmail($customerPaymentMethodId: ID!) {
customerPaymentMethodSendUpdateEmail(customerPaymentMethodId: $customerPaymentMethodId) {
customer {
id
}
userErrors {
field
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-07/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation sendCustomerPaymentUpdateEmail($customerPaymentMethodId: ID!) { customerPaymentMethodSendUpdateEmail(customerPaymentMethodId: $customerPaymentMethodId) { customer { id } userErrors { field message } } }",
"variables": {
"customerPaymentMethodId": "gid://shopify/CustomerPaymentMethod/b7cc6e3267aace169e516ed48be72dff"
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation sendCustomerPaymentUpdateEmail($customerPaymentMethodId: ID!) {
customerPaymentMethodSendUpdateEmail(customerPaymentMethodId: $customerPaymentMethodId) {
customer {
id
}
userErrors {
field
message
}
}
}`,
{
variables: {
"customerPaymentMethodId": "gid://shopify/CustomerPaymentMethod/b7cc6e3267aace169e516ed48be72dff"
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation sendCustomerPaymentUpdateEmail($customerPaymentMethodId: ID!) {
customerPaymentMethodSendUpdateEmail(customerPaymentMethodId: $customerPaymentMethodId) {
customer {
id
}
userErrors {
field
message
}
}
}`,
"variables": {
"customerPaymentMethodId": "gid://shopify/CustomerPaymentMethod/b7cc6e3267aace169e516ed48be72dff"
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation sendCustomerPaymentUpdateEmail($customerPaymentMethodId: ID!) {
customerPaymentMethodSendUpdateEmail(customerPaymentMethodId: $customerPaymentMethodId) {
customer {
id
}
userErrors {
field
message
}
}
}
QUERY
variables = {
"customerPaymentMethodId": "gid://shopify/CustomerPaymentMethod/b7cc6e3267aace169e516ed48be72dff"
}
response = client.query(query: query, variables: variables)
Input variables
JSON1{2 "customerPaymentMethodId": "gid://shopify/CustomerPaymentMethod/b7cc6e3267aace169e516ed48be72dff"3}
Response
JSON1{2 "customerPaymentMethodSendUpdateEmail": {3 "customer": {4 "id": "gid://shopify/Customer/544365967"5 },6 "userErrors": []7 }8}