Skip to main content

updateDiscountScheme

Requires permission products:discount:update.

Updates a discount scheme. The discount type is derived from the first discount rule and cannot be set directly. 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 UpdateDiscountScheme($data: UpdateDiscountSchemeDto!, $id: String!) {
updateDiscountScheme(data: $data, id: $id) {
id
code
name
type
createdAt
applicableCustomerTypes
partners {
id
createdAt
discountSchemeId
partnerId
updatedAt
}
}
}

Variables:

{
"data": {},
"id": "string"
}

Response:

{
"data": {
"updateDiscountScheme": {
"id": "id",
"code": "string",
"name": "string",
"type": "BUY_X_GET_Y",
"createdAt": "2025-01-15T00:00:00Z",
"applicableCustomerTypes": "string",
"partners": [
{
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"discountSchemeId": "string",
"partnerId": "string",
"updatedAt": "2025-01-15T00:00:00Z"
}
]
}
}
}
updateDiscountScheme(
data: UpdateDiscountSchemeDto!
id: String!
): DiscountScheme!

Arguments​

updateDiscountScheme.data ● UpdateDiscountSchemeDto! non-null input​

The fields to change.

updateDiscountScheme.id ● String! non-null scalar​

The ID of the discount scheme.

Type​

DiscountScheme object​

A discount scheme.