Introduced Standalone Prices in Beta
The Standalone Prices feature provides an alternative way to store your product prices as standalone resources. In comparison to prices embedded inside the Product, this new approach allows increasing the limit of prices per ProductVariant from 100 to 50.000. It also brings a more flexible way to query and manage your prices, separately from your Products, which contributes to better query performance.
The feature allows you to manage and query Standalone Prices through the Standalone Prices API, and to associate them to a ProductVariant via SKU. Additionally, a new priceMode
has been introduced on the Product that controls whether the Prices of the ProductVariants are embedded into the Product resource or stored separately as Standalone Prices.
Please note that currently it is not possible to use filters, facets, and sorting on Standalone Prices via the Product Projection Search endpoint.
Read more on Standalone Prices and how to use them in the API reference.
Changes:
- [API] Added Standalone Prices API.
- [API] Added
view_standalone_prices
andmanage_standalone_prices
OAuth scopes. - [API] Added optional field
priceMode
to Product and ProductDraft. - [API] Added Set PriceMode update action to Product.
- [API] Added
DuplicateStandalonePriceScope
andOverlappingStandalonePriceValidity
400 Bad Request errors specific to Standalone Prices. - [GraphQL API] Added the following types to the GraphQL schema:
ChangeStandalonePriceValue
,CreateStandalonePrice
,PriceMode
,SetProductPriceMode
,SetStandalonePriceCustomFields
,StandalonePrice
,StandalonePriceCustomField
,StandalonePriceQueryResult
,StandalonePriceUpdateAction
. - [GraphQL API] Changed the
Query
type:- Added the
standalonePrice
field to theQuery
type. - Added the
standalonePrices
field to theQuery
type.
- Added the
- [GraphQL API] Changed the
Mutation
type:- Added the
createStandalonePrice
field to theMutation
type. - Added the
deleteStandalonePrice
field to theMutation
type. - Added the
updateStandalonePrice
field to theMutation
type.
- Added the
- [GraphQL API] Changed the
Product
type:- Added the
priceMode
field to theProduct
type.
- Added the
- [GraphQL API] Changed the
ProductDraft
type:- Input field
priceMode
was added toProductDraft
type
- Input field
- [GraphQL API] Changed the
ProductUpdateAction
type:- Input field
setPriceMode
was added toProductUpdateAction
type
- Input field
The following changes were introduced in terms of GraphQL SDL:
extend type Query {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"standalonePrice("Queries with specified ID"id: String,"Queries with specified key"key: String): StandalonePrice"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"standalonePrices(where: String, sort: [String!], limit: Int, offset: Int): StandalonePriceQueryResult!}extend type Mutation {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"createStandalonePrice(draft: CreateStandalonePrice!): StandalonePrice"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"deleteStandalonePrice(version: Long!,"Queries with specified ID"id: String,"Queries with specified key"key: String): StandalonePrice"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"updateStandalonePrice(version: Long!, actions: [StandalonePriceUpdateAction!]!,"Queries with specified ID"id: String,"Queries with specified key"key: String): StandalonePrice}extend type Product {priceMode: PriceMode}extend input ProductDraft {priceMode: PriceMode}extend input ProductUpdateAction {setPriceMode: SetProductPriceMode}input ChangeStandalonePriceValue {value: BaseMoneyInput!}input CreateStandalonePrice {key: Stringsku: String!value: BaseMoneyInput!country: CountrycustomerGroup: ResourceIdentifierInputchannel: ResourceIdentifierInputvalidFrom: DateTimevalidUntil: DateTimetiers: [ProductPriceTierInput!] = []custom: StandalonePriceCustomFielddiscounted: DiscountedProductPriceValueInput}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"enum PriceMode {"The API looks up prices from Standalone Prices, stored separately from Products."Standalone"The API looks up prices from the `prices` field of the ProductVariant inside a Product."Embedded}input SetProductPriceMode {priceMode: PriceMode}input SetStandalonePriceCustomFields {name: String!value: String}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"type StandalonePrice implements Versioned {id: String!version: Long!key: Stringsku: String!value: BaseMoney!country: CountrycustomerGroupRef: ReferencechannelRef: ReferencevalidFrom: DateTimevalidUntil: DateTimetiers: [ProductPriceTier!]discounted: DiscountedProductPriceValuecustom: CustomFieldsTypecreatedAt: DateTime!lastModifiedAt: DateTime!createdBy: InitiatorlastModifiedBy: Initiator}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"input StandalonePriceCustomField {typeId: StringtypeKey: Stringtype: ResourceIdentifierInputfields: CustomFieldsDraft!}type StandalonePriceQueryResult {offset: Int!count: Int!total: Long!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"exists: Boolean!results: [StandalonePrice!]!}input StandalonePriceUpdateAction {changeValue: ChangeStandalonePriceValuesetCustomType: CustomFieldsDraftsetCustomField: SetStandalonePriceCustomFields}