Skip to main content

assignProductsToScheme

Requires permission products:discount:update.

Replaces the products a discount scheme applies to with the list given. The existing assignments are removed first, and the scheme and every product 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 AssignProductsToScheme($data: AssignProductsDto!, $schemeId: String!) {
assignProductsToScheme(data: $data, schemeId: $schemeId)
}

Variables:

{
"data": {
"productIds": [
"string"
]
},
"schemeId": "string"
}

Response:

{
"data": {
"assignProductsToScheme": true
}
}
assignProductsToScheme(
data: AssignProductsDto!
schemeId: String!
): Boolean!

Arguments​

assignProductsToScheme.data ● AssignProductsDto! non-null input​

The IDs of the products the scheme should apply to.

assignProductsToScheme.schemeId ● String! non-null scalar​

The ID of the discount scheme.

Type​

Boolean scalar​

The Boolean scalar type represents true or false.