All Release Notes

Added key to Embedded Prices and Embedded PriceDrafts, and an update action to set keys for both Standalone and Embedded Prices

12 December 2022
Composable Commerce
HTTP API
Enhancement
Pricing and DiscountsGraphQL

In addition to identifying Embedded Prices by their id, you can now use key as a user-defined unique identifier. By assigning a human-readable key to Embedded Prices, you have greater flexibility for referencing Embedded Prices.

The key field was already available for StandalonePrices and this allowed us to assess and confirm its usefulness. Implementing the key field in Embedded Prices ensures consistency in offerings for both Standalone Prices and Embedded Prices.

Update actions for setting the key value has also been added for both Embedded Prices and Standalone Prices, allowing you to efficiently update Price keys without needing to bulk import Prices with the updated price keys.

Changes:

  • [API] Added keyfield to Price and PriceDraft.
  • [API] Added Set Price Key update action.
  • [API] Added Set Standalone Price Key update action.
  • [API] Added the error code DuplicatePriceKey.
  • [API] Added ProductPriceKeySet Message.
  • [API] Added StandalonePriceKeySet Message.
  • [GraphQL API] Changed the ProductPrice type:
    • Added the key field to the ProductPrice type.
  • [GraphQL API] Changed the ProductPriceSearch type:
    • Added the key field to the ProductPriceSearch type.
  • [GraphQL API] Changed the ProductPriceDataInput type:
    • Input field key was added to ProductPriceDataInput type
  • [GraphQL API] Added the following types to the GraphQL schema: SetProductPriceKey, SetStandalonePriceKey, StandalonePriceKeySet, ProductPriceKeySet.
  • [GraphQL API] Changed the ProductUpdateAction type:
    • Input field setPriceKey was added to ProductUpdateAction type
  • [GraphQL API] Changed the StandalonePriceUpdateAction type:
    • Input field setKey was added to StandalonePriceUpdateAction type

The following changes were introduced in terms of GraphQL SDL:

extend type ProductPrice {
key: String
}
extend type ProductPriceSearch {
key: String
}
extend input ProductPriceDataInput {
key: String
}
extend input ProductUpdateAction {
setPriceKey: SetProductPriceKey
}
input SetProductPriceKey {
priceId: String!
key: String
staged: Boolean = true
}
type ProductPriceKeySet implements MessagePayload {
variantId: Int!
priceId: String
oldKey: String
key: String
staged: Boolean!
type: String!
}
extend input StandalonePriceUpdateAction {
setKey: SetStandalonePriceKey
}
input SetStandalonePriceKey {
key: String
}
type StandalonePriceKeySet implements MessagePayload {
key: String
oldKey: String
type: String!
}