Anchor to customerSendAccountInviteEmailcustomer
customerSendAccountInviteEmail
mutation
Requires access scope.
Sends the customer an account invite email.
Anchor to Arguments
Arguments
- Anchor to customerIdcustomer•
Id ID!required The ID of the customer to whom an account invite email is to be sent.
- Anchor to emailemail•
Specifies the account invite email fields.
Was this section helpful?
Anchor to CustomerSendAccountInviteEmailPayload returnsCustomerSendAccountInviteEmailPayload returns
- Anchor to customercustomer•
The customer to whom an account invite email was sent.
- Anchor to userErrorsuser•
Errors The list of errors that occurred from executing the mutation.
Was this section helpful?
- Sends an account invite to a customer
- customerSendAccountInviteEmail reference
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation CustomerSendAccountInviteEmail($customerId: ID!) {
customerSendAccountInviteEmail(customerId: $customerId) {
customer {
id
}
userErrors {
field
message
}
}
}`,
{
variables: {
"customerId": "gid://shopify/Customer/105906728"
},
},
);
const data = await response.json();
mutation CustomerSendAccountInviteEmail($customerId: ID!) {
customerSendAccountInviteEmail(customerId: $customerId) {
customer {
id
}
userErrors {
field
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation CustomerSendAccountInviteEmail($customerId: ID!) { customerSendAccountInviteEmail(customerId: $customerId) { customer { id } userErrors { field message } } }",
"variables": {
"customerId": "gid://shopify/Customer/105906728"
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation CustomerSendAccountInviteEmail($customerId: ID!) {
customerSendAccountInviteEmail(customerId: $customerId) {
customer {
id
}
userErrors {
field
message
}
}
}`,
{
variables: {
"customerId": "gid://shopify/Customer/105906728"
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation CustomerSendAccountInviteEmail($customerId: ID!) {
customerSendAccountInviteEmail(customerId: $customerId) {
customer {
id
}
userErrors {
field
message
}
}
}`,
"variables": {
"customerId": "gid://shopify/Customer/105906728"
},
},
});
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 CustomerSendAccountInviteEmail($customerId: ID!) {
customerSendAccountInviteEmail(customerId: $customerId) {
customer {
id
}
userErrors {
field
message
}
}
}
QUERY
variables = {
"customerId": "gid://shopify/Customer/105906728"
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"customerId": "gid://shopify/Customer/105906728"
}
Response
JSON{
"customerSendAccountInviteEmail": {
"customer": {
"id": "gid://shopify/Customer/105906728"
},
"userErrors": []
}
}