assignableCustomers
Requires a tenant administrator.
Lists customers that can be assigned to a given sales rep, one page at a time, never including customers that rep already owns. Backs the Assign customers picker on a user. 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
query AssignableCustomers($input: AssignableCustomersInput!) {
assignableCustomers(input: $input) {
hasNextPage
page
pageSize
totalCount
items {
id
code
name
assignedSalesRepName
status
assignedSalesRepId
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query AssignableCustomers($input: AssignableCustomersInput!) {\n assignableCustomers(input: $input) {\n hasNextPage\n page\n pageSize\n totalCount\n items {\n id\n code\n name\n assignedSalesRepName\n status\n assignedSalesRepId\n }\n }\n}",
"variables": {
"input": {
"repId": "id"
}
}
}
EOF
Variables:
{
"input": {
"repId": "id"
}
}
Response:
{
"data": {
"assignableCustomers": {
"hasNextPage": true,
"page": 0,
"pageSize": 0,
"totalCount": 0,
"items": [
{
"id": "id",
"code": "string",
"name": "string",
"assignedSalesRepName": "string",
"status": "string",
"assignedSalesRepId": "id"
}
]
}
}
}
assignableCustomers(
input: AssignableCustomersInput!
): AssignableCustomersPage!
Arguments
assignableCustomers.input ● AssignableCustomersInput! non-null input
The target sales rep and the search and paging options for the list.
Type
AssignableCustomersPage object
A page of customers that can be assigned.