Queries and mutations for managing Shopping Lists in the platform.
Queries
Query Shopping Lists
| Arguments | |
|---|---|
whereString | |
sortArray of String | |
limitInt | |
offsetInt | |
Get Shopping List
| Arguments | |
|---|---|
idString | Queries with specified ID |
keyString | Queries with specified key |
Mutations
Create Shopping List
| Arguments | |
|---|---|
draft | |
storeKey | The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions. |
asAssociate | Create/modify entity as an associate in business-unit. |
Update Shopping List
| Arguments | |
|---|---|
versionLong | |
actionsArray of ShoppingListUpdateAction | |
storeKey | The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions. |
asAssociate | Create/modify entity as an associate in business-unit. |
idString | Queries with specified ID |
keyString | Queries with specified key |
Delete Shopping List
| Arguments | |
|---|---|
versionLong | |
personalDataErasureBoolean | Default: false |
storeKey | The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions. |
asAssociate | Create/modify entity as an associate in business-unit. |
idString | Queries with specified ID |
keyString | Queries with specified key |
Create My Shopping List
| Arguments | |
|---|---|
draft | |
storeKey | The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions. |
Update My Shopping List
| Arguments | |
|---|---|
versionLong | |
actionsArray of MyShoppingListUpdateAction | |
storeKey | The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions. |
idString | Queries with specified ID |
keyString | Queries with specified key |
Delete My Shopping List
| Arguments | |
|---|---|
versionLong | |
storeKey | The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions. |
idString | Queries with specified ID |
keyString | Queries with specified key |
Output types
ShoppingList
keyString | User-defined unique identifier of the ShoppingList. |
nameString | Name of the ShoppingList. |
nameAllLocalesArray of LocalizedString | Name of the ShoppingList. |
descriptionString | Description of the ShoppingList. |
descriptionAllLocalesArray of LocalizedString | Description of the ShoppingList. |
slugString | Human-readable identifiers usually used as deep-link URL to the related ShoppingList.
Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages.
The slug must match the pattern [a-zA-Z0-9_-]{2,256}. For good performance, indexes are provided for the first 15 languages set on the Project. |
slugAllLocalesArray of LocalizedString | Human-readable identifiers usually used as deep-link URL to the related ShoppingList.
Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages.
The slug must match the pattern [a-zA-Z0-9_-]{2,256}. For good performance, indexes are provided for the first 15 languages set on the Project. |
customerRef | Reference to a Customer associated with the ShoppingList. |
customer | Reference to a Customer associated with the ShoppingList. |
businessUnit | |
businessUnitRef | |
storeRef | Store to which the ShoppingList is assigned. |
store | Store to which the ShoppingList is assigned. |
anonymousIdString | Identifies ShoppingLists belonging to an anonymous session. |
lineItemsArray of ShoppingListLineItem | Line Items (containing Products) of the ShoppingList. |
textLineItemsArray of TextLineItem | Line Items (containing text values) of the ShoppingList. |
custom | Custom Fields defined for the ShoppingList. |
deleteDaysAfterLastModificationInt | Number of days after the last modification before a ShoppingList is deleted. If not set, the default value configured in the Project is used. |
idString | Unique identifier of the ShoppingList. |
versionLong | Current version of the ShoppingList. |
createdAt | Date and time (UTC) the ShoppingList was initially created. |
lastModifiedAt | Date and time (UTC) the ShoppingList was last updated. |
createdBy | IDs and references that created the ShoppingList. |
lastModifiedBy | IDs and references that last modified the ShoppingList. |
ShoppingListLineItem
productSlug and variant, defined with the query parameter expand.idString | Unique identifier of the ShoppingListLineItem. |
keyString | User-defined identifier of the ShoppingListLineItem. It is unique per ShoppingList. |
productIdString | Unique identifier of a Product. |
publishedBoolean | Whether the related Product is published or not.
This data is updated in an eventual consistent manner when the Product's published status changes. |
variantIdInt | id of the ProductVariant the ShoppingListLineItem refers to. If not set, the ShoppingListLineItem refers to the Master Variant.For a Project with ProductCatalogModel set to Modular, when variantId is not set, the ShoppingListLineItem refers to the Product's default Variant (defaultVariant) instead of the Master Variant. If no default Variant is set, the ShoppingListLineItem refers to the Variant with the lowest variantId. |
productTypeRef | The Product Type defining the Attributes of the Product. |
productType | The Product Type defining the Attributes of the Product. |
quantityInt | Number of Products in the ShoppingListLineItem. |
addedAt | Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList. |
nameString | Name of the Product. This data is updated in an eventual consistent manner when the Product's name changes. |
nameAllLocalesArray of LocalizedString | Name of the Product. This data is updated in an eventual consistent manner when the Product's name changes. |
deactivatedAt | If the Product or Product Variant is deleted or unpublished,
deactivatedAt is the date and time (UTC) this occurred.This data is updated in an eventual consistent manner when the Product Variant cannot be ordered anymore. |
custom | Custom Fields of the ShoppingListLineItem. |
productSlugString | Slug of the current ProductData.
Returned when expanded using expand=lineItems[*].productSlug. You cannot expand only a single element of the array. |
productSlugAllLocalesArray of LocalizedString | Slug of the current ProductData.
Returned when expanded using expand=lineItems[*].productSlug. You cannot expand only a single element of the array. |
variant | Data of the ProductVariant. This data includes all the Product Attributes and Variant Attributes to ensure the full Attribute context of the Product Variant.
Returned when expanded using expand=lineItems[*].variant. You cannot expand only a single element of the array. |
ProductVariant
Classic.
When the Project has the Modular catalog model, use the Variants API instead.idInt | A unique, sequential identifier of the Product Variant within the Product. |
keyString | User-defined identifier of the ProductVariant. Unique among ProductVariants in the same Product. This is different from Product key. |
skuString | User-defined SKU of the Product Variant. Unique across all ProductVariants in a Project. |
pricesArray of ProductPrice | If the Product is projected by Store, this field only contains Embedded Prices that are valid for that Store.
Cannot contain two Embedded Prices with the same scopes (currency, country, Customer Group, Channel, validFrom and validUntil). |
price | Returns a single price based on the price selection rules. |
allRecurrencePricesArray of ProductPrice | Returns all recurrence prices based on the price selection rules. |
imagesArray of Image | Images of the Product Variant. |
assetsArray of Asset | Media assets of the Product Variant. |
availability | Set if the Product Variant is tracked by Inventory.
Can be used as an optimization to reduce calls to the Inventory service.
May not contain the latest Inventory State (it is eventually consistent). |
attributesRawArray of RawProductAttribute | This field contains raw attributes data |
ProductPrice
idString | |
value | |
keyString | |
country | |
customerGroup | |
customerGroupRef | |
channel | |
channelRef | |
validFrom | |
validUntil | |
discounted | |
tiersArray of ProductPriceTier | |
custom | |
recurrencePolicy | |
recurrencePolicyRef |
DiscountedProductPriceValue
value | |
discountRef | |
discount |
ProductPriceTier
minimumQuantityInt | |
value |
ProductVariantAvailabilityWithChannels
noChannel | |
channels |
ProductVariantAvailability
Product variant availability
isOnStockBoolean | Whether the Product Variant is in stock, based on an InventoryEntry that has no assigned supply Channel.
This value reflects global or default availability; it does not aggregate the channel-specific availabilities found in the channels field. |
restockableInDaysInt | Number of days to restock a Product Variant once it is out of stock. |
availableQuantityLong | Number of items of the Product Variant that are in stock. |
versionLong | Current version of the InventoryEntry. |
idString | Unique identifier of the InventoryEntry. |
ProductVariantAvailabilitiesResult
Product variant availabilities
limitInt | |
offsetInt | |
totalInt | |
resultsArray of ProductVariantAvailabilityWithChannel |
ProductVariantAvailabilityWithChannel
channelRef | |
channel | |
availability |
RawProductAttribute
attributeDefinition | |
nameString | |
valueJson | |
attributesRawArray of RawProductAttribute | BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta |
referencedResource | |
referencedResourceSetArray of ReferenceExpandable |
AttributeDefinition
type | Describes the Type of the Attribute. |
nameString | User-defined name of the Attribute that is unique within the Project. |
labelString | Human-readable label for the Attribute. |
isRequiredBoolean | Whether the Attribute must have a value on a ProductVariant. |
attributeConstraint | Specifies how Attributes are validated across all variants of a Product. Can beNone, Unique, CombinationUnique, or SameForAll |
level | Specifies whether the Attribute is defined at the Product or Variant level. Can beVariant, or Product |
inputTipString | Provides additional Attribute information to aid content managers configure Product details. |
inputHint | Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType). Can be SingleLine, or MultiLine |
isSearchableBoolean | Whether the Attribute's values are available in the Product Search or the Product Projection Search API for use in full-text search queries, filters, and facets.
However, if an Attribute's
level is set as Product, then Product Projection Search does not support the Attribute.
To use the Attribute in search, filters, or facets, set isSearchable to true for all AttributeDefinitions with the same name across different ProductTypes.
If the isSearchable values are different, the Attribute isn't available for search, filters, or facets.The exact features that are available with this flag depend on the specific AttributeType.
The maximum size of a searchable field is restricted by the Field content size limit.
This constraint is enforced at both Product creation and Product update.
If the length of the input exceeds the maximum size, an InvalidField error is returned. |
savedToLineItemBoolean | Whether the Attribute value is copied onto the LineItem when the Product is added to a Cart.
When
false, the Attribute value is excluded from the Line Item variant. Line Items already in a Cart are not immediately affected by a change to this value. Existing Line Items are updated the next time their Product data is refreshed, such as when a Recalculate update action is performed with updateProductData set to true, or on a Cart update that triggers an API Extension. Replicating a Cart creates a new Cart that contains the current Product data; it does not update the original Cart.When savedToLineItem is false, LineItem predicates that reference this Attribute, such as those in Cart Discounts and Shipping Methods, evaluate as if the Attribute is not set. |
labelAllLocalesArray of LocalizedString | Human-readable label for the Attribute. |
inputTipAllLocalesArray of LocalizedString | Provides additional Attribute information to aid content managers configure Product details. |
AttributeDefinitionType
AttributeConstraint
None- No constraints are applied to the attribute
Unique- Attribute value should be different in each variant
CombinationUnique- A set of attributes, that have this constraint, should have different combinations in each variant
SameForAll- Attribute value should be the same in all variants
Level
Variant- The attribute can be used on the variant level
Product- The attribute can be used on the product level
TextLineItem
TextLineItems are Line Items that use text values instead of references to Products.
idString | Unique identifier of the TextLineItem. |
keyString | User-defined identifier of the TextLineItem. It is unique per ShoppingList. |
nameString | Name of the TextLineItem. |
nameAllLocalesArray of LocalizedString | Name of the TextLineItem. |
descriptionString | Description of the TextLineItem. |
descriptionAllLocalesArray of LocalizedString | Description of the TextLineItem. |
quantityInt | Number of entries in the TextLineItem. |
custom | Custom Fields of the TextLineItem. |
addedAt | Date and time (UTC) the TextLineItem was added to the ShoppingList. |
ShoppingListQueryResult
offsetInt | |
countInt | |
totalLong | |
existsBoolean | |
resultsArray of ShoppingList |
Input types
ShoppingListDraft
nameArray of LocalizedStringItemInputType | Name of the ShoppingList. |
descriptionArray of LocalizedStringItemInputType | Description of the ShoppingList. |
lineItemsArray of ShoppingListLineItemDraft | Line Items (containing Products) to add to the ShoppingList. Default:[] |
textLineItemsArray of TextLineItemDraft | Line Items (containing text values) to add to the ShoppingList. Default:[] |
custom | Custom Fields defined for the ShoppingList. |
deleteDaysAfterLastModificationInt | Number of days after the last modification before a ShoppingList is deleted. If not set, the default value configured in the Project is used. |
businessUnit | ResourceIdentifier of the Business Unit the Shopping List should belong to. When the customer of the Shopping List is set, the Customer must be an Associate of the Business Unit. Only available for B2B-enabled Projects. |
keyString | User-defined unique identifier for the ShoppingList. |
customer | The Customer the ShoppingList should be associated to. |
slugArray of LocalizedStringItemInputType | Human-readable identifiers usually used as deep-link URL to the related ShoppingList.
Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages.
The slug must match the pattern [a-zA-Z0-9_-]{2,256}. |
anonymousIdString | Identifies ShoppingLists belonging to an anonymous session. |
store | Assigns the new ShoppingList to the Store. |
ShoppingListLineItemDraft
productID and variantID, or by the sku.productIdString | Unique identifier of a Product. |
keyString | User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList. |
skuString | sku of the ProductVariant. |
variantIdInt | id of the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.For a Project with ProductCatalogModel set to Modular, when variantId is not set, the ShoppingListLineItem refers to the Product's default Variant (defaultVariant) instead of the Master Variant. If no default Variant is set, the ShoppingListLineItem refers to the Variant with the lowest variantId. |
quantityInt | Number of Products in the ShoppingListLineItem. Default:1 |
custom | Custom Fields for the ShoppingListLineItem. |
addedAt | Date and time the ShoppingListLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used. |
TextLineItemDraft
keyString | User-defined unique identifier of the TextLineItem. Must be unique per ShoppingList. |
nameArray of LocalizedStringItemInputType | Name of the TextLineItem. |
descriptionArray of LocalizedStringItemInputType | Description of the TextLineItem. |
quantityInt | Number of entries in the TextLineItem. Default:1 |
custom | Custom Fields for the TextLineItem. |
addedAt | Date and time the TextLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used. |
MyShoppingListDraft
customer field of ShoppingList is automatically set with
a password flow token.
The anonymousId is automatically set with a token for an anonymous session.
The key and slug fields can not be set.nameArray of LocalizedStringItemInputType | Name of the ShoppingList. |
descriptionArray of LocalizedStringItemInputType | Description of the ShoppingList. |
lineItemsArray of ShoppingListLineItemDraft | Line Items (containing Products) to add to the ShoppingList. Default: [] |
textLineItemsArray of TextLineItemDraft | Line Items (containing text values) to add to the ShoppingList. Default: [] |
custom | Custom Fields defined for the ShoppingList. |
deleteDaysAfterLastModificationInt | Number of days after the last modification before a ShoppingList is deleted. If not set, the default value configured in the Project is used. |
store | Assigns the new ShoppingList to the Store. The Store assignment can not be modified. |
ShoppingListLineItemDraft
productID and variantID, or by the sku.productIdString | Unique identifier of a Product. |
keyString | User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList. |
skuString | sku of the ProductVariant. |
variantIdInt | id of the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.For a Project with ProductCatalogModel set to Modular, when variantId is not set, the ShoppingListLineItem refers to the Product's default Variant (defaultVariant) instead of the Master Variant. If no default Variant is set, the ShoppingListLineItem refers to the Variant with the lowest variantId. |
quantityInt | Number of Products in the ShoppingListLineItem. Default:1 |
custom | Custom Fields for the ShoppingListLineItem. |
addedAt | Date and time the ShoppingListLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used. |
TextLineItemDraft
keyString | User-defined unique identifier of the TextLineItem. Must be unique per ShoppingList. |
nameArray of LocalizedStringItemInputType | Name of the TextLineItem. |
descriptionArray of LocalizedStringItemInputType | Description of the TextLineItem. |
quantityInt | Number of entries in the TextLineItem. Default:1 |
custom | Custom Fields for the TextLineItem. |
addedAt | Date and time the TextLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used. |
ShoppingListUpdateAction
addLineItem | |
addTextLineItem | |
changeLineItemQuantity | |
changeLineItemsOrder | |
changeName | |
changeTextLineItemName | |
changeTextLineItemQuantity | |
changeTextLineItemsOrder | |
removeLineItem | |
removeTextLineItem | |
setAnonymousId | |
setBusinessUnit | |
setCustomField | |
setCustomType | |
setCustomer | |
setDeleteDaysAfterLastModification | |
setDescription | |
setKey | |
setLineItemCustomField | |
setLineItemCustomType | |
setSlug | |
setStore | |
setTextLineItemCustomField | |
setTextLineItemCustomType | |
setTextLineItemDescription |
MyShoppingListUpdateAction
addLineItem | |
addTextLineItem | |
changeLineItemQuantity | |
changeLineItemsOrder | |
changeName | |
changeTextLineItemName | |
changeTextLineItemQuantity | |
changeTextLineItemsOrder | |
removeLineItem | |
removeTextLineItem | |
setCustomField | |
setCustomType | |
setDeleteDaysAfterLastModification | |
setDescription | |
setLineItemCustomField | |
setLineItemCustomType | |
setStore | |
setTextLineItemCustomField | |
setTextLineItemCustomType | |
setTextLineItemDescription |
Update actions
Add LineItem
productID and variantID, or by the sku.
If the ShoppingList already contains a ShoppingListLineItem for the same Product Variant with the same Custom Fields, then only the quantity of the existing ShoppingListLineItem is increased.
A ShoppingListLineItem with an empty variantId is not considered the same as a ShoppingListLineItem with a variantId currently referring to the Master Variant.Product Attributes are merged with Variant Attributes to ensure the full Attribute context of the Product Variant.
addedAt | Date and time the ShoppingListLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used. |
custom | Custom Fields defined for the ShoppingListLineItem. |
quantityInt | Number of Products in the ShoppingListLineItem. Default:1 |
variantIdInt | id of the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.For a Project with ProductCatalogModel set to Modular, when variantId is not set, the ShoppingListLineItem refers to the Product's default Variant (defaultVariant) instead of the Master Variant. If no default Variant is set, the ShoppingListLineItem refers to the Variant with the lowest variantId. |
skuString | sku of the ProductVariant. |
keyString | User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList. |
productIdString | Unique identifier of a Product. |
Add TextLineItem
addedAt | Date and time the TextLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used. |
custom | Custom Fields defined for the TextLineItem. |
quantityInt | Number of entries in the TextLineItem. Default:1 |
descriptionArray of LocalizedStringItemInputType | Description of the TextLineItem. |
nameArray of LocalizedStringItemInputType | Name of the TextLineItem. |
keyString | User-defined identifier of the TextLineItem. Must be unique per ShoppingList. |
Change LineItem Quantity
lineItemIdString | |
lineItemKeyString | |
quantityInt | New value to set. If 0, the ShoppingListLineItem is removed from the ShoppingList. |
Change LineItems Order
lineItemOrderArray of String | All existing ShoppingListLineItem ids in the desired new order. |
Change Name
nameArray of LocalizedStringItemInputType | New value to set. Must not be empty. |
Change TextLineItem Name
textLineItemIdString | |
textLineItemKeyString | |
nameArray of LocalizedStringItemInputType | New value to set. Must not be empty. |
Change TextLineItem Quantity
textLineItemIdString | |
textLineItemKeyString | |
quantityInt | New value to set. If 0, the TextLineItem is removed from the ShoppingList. |
Change TextLineItems Order
textLineItemOrderArray of String | Must contain all existing TextLineItem ids in the desired new order. |
Remove LineItem
lineItemIdString | |
lineItemKeyString | |
quantityInt | Amount to remove from the quantity of the ShoppingListLineItem. If not set, the ShoppingListLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the ShoppingListLineItem, the ShoppingListLineItem is removed from the ShoppingList. |
Remove TextLineItem
textLineItemIdString | |
textLineItemKeyString | |
quantityInt | Amount to remove from the quantity of the TextLineItem. If not set, the TextLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the TextLineItem, the TextLineItem is removed from the ShoppingList. |
Set AnonymousId
anonymousIdString | Value to set. If omitted, any existing value is removed. |
Set Business Unit B2B B2X
Updates the Business Unit on the Shopping List. The Shopping List must have an existing Business Unit assigned already.
businessUnit | The Business Unit to assign to the Shopping List, which must have access to the Store that is set on the Shopping List. |
Set CustomField
nameString | Name of the Custom Field. |
valueString | If value is absent or null, this field will be removed if it exists.
Removing a field that does not exist returns an InvalidOperation error.
If value is provided, it is set for the field defined by name. |
Set Custom Type
fieldsArray of CustomFieldInput | |
type | |
typeKeyString | |
typeIdString |
Set Customer
customer | The Customer the ShoppingList should be associated to. If omitted, any existing value is removed. |
Set DeleteDaysAfterLastModification
Number of days after the last modification before a Shopping List is deleted.
deleteDaysAfterLastModificationInt | Value to set. If omitted, the default value for this field configured in Project settings is assigned. |
Set Description
descriptionArray of LocalizedStringItemInputType | Value to set. If omitted, any existing value is removed. |
Set Key
keyString | Value to set. If omitted, any existing value is removed. |
Set LineItem CustomField
lineItemIdString | |
lineItemKeyString | |
nameString | Name of the Custom Field. |
valueString | If value is absent or null, this field will be removed if it exists.
Removing a field that does not exist returns an InvalidOperation error.
If value is provided, it is set for the field defined by name. |
Set LineItem Custom Type
lineItemIdString | |
lineItemKeyString | |
fieldsArray of CustomFieldInput | |
type | |
typeKeyString | |
typeIdString |
Set Slug
slugArray of LocalizedStringItemInputType | Value to set. If omitted, any existing value is removed. Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages. Must match the pattern ^[A-Za-z0-9_-]{2,256}+$ |
Set Store
store | The Store the ShoppingList should be assigned to. If omitted, any existing value is removed. |
Set TextLineItem CustomField
textLineItemIdString | |
textLineItemKeyString | |
nameString | Name of the Custom Field. |
valueString | If value is absent or null, this field will be removed if it exists.
Removing a field that does not exist returns an InvalidOperation error.
If value is provided, it is set for the field defined by name. |
Set TextLineItem Custom Type
textLineItemIdString | |
textLineItemKeyString | |
fieldsArray of CustomFieldInput | |
type | |
typeKeyString | |
typeIdString |
Set TextLineItem Description
textLineItemIdString | |
textLineItemKeyString | |
descriptionArray of LocalizedStringItemInputType | Value to set. If omitted, any existing value is removed. |