assignCustomersToScheme
Requires permission products:discount:update.
Replaces the customers a discount scheme applies to with the list given. The existing assignments are removed first, and the scheme and every customer must belong to the organization. Needs the discounts update permission.
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 AssignCustomersToScheme($data: AssignCustomersDto!, $schemeId: String!) {
assignCustomersToScheme(data: $data, schemeId: $schemeId)
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation AssignCustomersToScheme($data: AssignCustomersDto!, $schemeId: String!) {\n assignCustomersToScheme(data: $data, schemeId: $schemeId)\n}",
"variables": {
"data": {
"customerIds": [
"string"
]
},
"schemeId": "string"
}
}
EOF
Variables:
{
"data": {
"customerIds": [
"string"
]
},
"schemeId": "string"
}
Response:
{
"data": {
"assignCustomersToScheme": true
}
}
assignCustomersToScheme(
data: AssignCustomersDto!
schemeId: String!
): Boolean!
Arguments
assignCustomersToScheme.data ● AssignCustomersDto! non-null input
The IDs of the customers the scheme should apply to.
assignCustomersToScheme.schemeId ● String! non-null scalar
The ID of the discount scheme.
Type
Boolean scalar
The Boolean scalar type represents true or false.