bulkReassignCustomers
Requires a tenant administrator.
Moves every customer owned by one sales rep to another, for example when a rep leaves. Future orders go to the new rep; past orders and commissions stay with the old one. Returns how many customers were moved. Tenant admins only.
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 BulkReassignCustomers($fromRepId: ID!, $toRepId: ID!) {
bulkReassignCustomers(fromRepId: $fromRepId, toRepId: $toRepId) {
count
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation BulkReassignCustomers($fromRepId: ID!, $toRepId: ID!) {\n bulkReassignCustomers(fromRepId: $fromRepId, toRepId: $toRepId) {\n count\n }\n}",
"variables": {
"fromRepId": "id",
"toRepId": "id"
}
}
EOF
Variables:
{
"fromRepId": "id",
"toRepId": "id"
}
Response:
{
"data": {
"bulkReassignCustomers": {
"count": 0
}
}
}
bulkReassignCustomers(
fromRepId: ID!
toRepId: ID!
): BulkReassignResult!
Arguments
bulkReassignCustomers.fromRepId ● ID! non-null scalar
The ID of the sales rep who currently owns the customers.
bulkReassignCustomers.toRepId ● ID! non-null scalar
The ID of the sales rep who will own the customers.
Type
BulkReassignResult object
The result of moving customers to another rep.