Skip to main content

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:

mutation AssignCustomersToScheme($data: AssignCustomersDto!, $schemeId: String!) {
assignCustomersToScheme(data: $data, schemeId: $schemeId)
}

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.