inviteCustomerUser
Requires permission customers:customer_user:create.
Invites a person to sign in for a customer company and sends them a single-use link that expires. They sign in with one-time codes only. Needs customers:customer_user:create.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation InviteCustomerUser($input: InviteCustomerUserInput!) {
inviteCustomerUser(input: $input) {
email
invited
userId
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation InviteCustomerUser($input: InviteCustomerUserInput!) {\n inviteCustomerUser(input: $input) {\n email\n invited\n userId\n }\n}",
"variables": {
"input": {
"email": "string",
"partnerId": "id"
}
}
}
EOF
Variables:
{
"input": {
"email": "string",
"partnerId": "id"
}
}
Response:
{
"data": {
"inviteCustomerUser": {
"email": "string",
"invited": true,
"userId": "id"
}
}
}
inviteCustomerUser(
input: InviteCustomerUserInput!
): InviteCustomerUserResult!
Arguments
inviteCustomerUser.input ● InviteCustomerUserInput! non-null input
The company, the person's email and name, their role, order limit, whether they approve orders, and the addresses assigned to them.
Type
InviteCustomerUserResult object
The result of inviting a person.