6 December 2022
Pricing and DiscountsGraphQLMessages/Subscriptions
You can now subscribe to Messages about adding, changing, setting, and removing Embedded Prices on Products, as well as setting the PriceMode on Products.
Changes:
- [API] Added ProductPriceAdded Message.
- [API] Added ProductPriceChanged Message.
- [API] Added ProductPricesSet Message.
- [API] Added ProductPriceRemoved Message.
- [API] Added ProductPriceModeSet Message.
- [GraphQL API] Added the following types to the GraphQL schema:
ProductPriceAdded
,ProductPriceChanged
,ProductPriceModeSet
,ProductPriceRemoved
,ProductPricesSet
.
The following changes were introduced in terms of GraphQL SDL:
type ProductPriceAdded implements MessagePayload {
variantId: Int!
price: ProductPrice!
staged: Boolean!
hasStagedChanges: Boolean
type: String!
}
type ProductPriceChanged implements MessagePayload {
variantId: Int!
oldPrice: ProductPrice!
newPrice: ProductPrice!
staged: Boolean!
oldStagedPrice: ProductPrice
hasStagedChanges: Boolean
type: String!
}
type ProductPriceModeSet implements MessagePayload {
to: PriceMode
type: String!
}
type ProductPriceRemoved implements MessagePayload {
variantId: Int!
price: ProductPrice!
staged: Boolean!
hasStagedChanges: Boolean
type: String!
}
type ProductPricesSet implements MessagePayload {
variantId: Int!
prices: [ProductPrice!]!
staged: Boolean!
hasStagedChanges: Boolean
type: String!
}