9 September 2022
Pricing and DiscountsGraphQL
With the new 'active' field on Standalone Prices you can activate or deactivate individual Standalone Prices. This allows you to make changes or edits to your prices without them being visible to your customers. When a Standalone Price is not active, it is not considered during price selection. All existing Standalone Prices received an active status.
Changes:
- [API] Added field
activeto StandalonePrice - [API] Added field
activeto StandalonePriceDraft - [API] Added
changeActiveupdate action to StandalonePrice - [API] Added StandalonePriceActiveChanged Message
- [GraphQL API] Added the following types to the GraphQL schema:
ChangeStandalonePriceActive,StandalonePriceActiveChanged. - [GraphQL API] Changed the
CreateStandalonePricetype:- Input field
activewas added toCreateStandalonePricetype
- Input field
- [GraphQL API] Changed the
StandalonePriceUpdateActiontype:- Input field
changeActivewas added toStandalonePriceUpdateActiontype
- Input field
- [GraphQL API] Changed the
StandalonePricetype:StandalonePricetype description is changed- Added the
activefield to theStandalonePricetype.
The following changes were introduced in terms of GraphQL SDL:
extend type StandalonePrice {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
active: Boolean!
expiresAt: DateTime
}
extend input CreateStandalonePrice {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
active: Boolean! = true
}
extend input StandalonePriceUpdateAction {
changeActive: ChangeStandalonePriceActive
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input ChangeStandalonePriceActive {
active: Boolean!
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type StandalonePriceActiveChanged implements MessagePayload {
active: Boolean!
oldActive: Boolean!
type: String!
}