My Shopping Lists
The My Shopping Lists endpoint creates and provides access to Shopping Lists scoped to a specific Customer. The endpoint requires an access token from the password flow or anonymous session flow.
The My Shopping Lists endpoint intentionally provides access to a limited subset of the fields on a Shopping List. This provides extra security in scenarios where the client application must communicate directly with the Composable Commerce API on behalf of a customer, such as commerce in a mobile application. If you need to modify a field available on the full Shopping List resource, pass the response from the My Shopping List endpoint to an internal service in your client application which accesses the Shopping List resource.
Representations
Responses are equal to the responses on the Shopping List endpoint, but requests may differ.
MyShoppingListDraft
A MyShoppingListDraft is the object submitted as payload to the Create MyShoppingList request.
The 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.
name | Name of the ShoppingList. |
description | Description of the ShoppingList. |
lineItems Array of ShoppingListLineItemDraft | Line Items (containing Products) to add to the ShoppingList. |
textLineItems Array of TextLineItemDraft | Line Items (containing text values) to add to the ShoppingList. |
deleteDaysAfterLastModification Int | Number of days after which the ShoppingList will be automatically deleted if it has not been modified. 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. |
custom | Custom Fields defined for the ShoppingList. |
{"name": {"en": "My shopping list"},"description": {"en": "Description of my shopping list"},"lineItems": [{"sku": "product-variant-sku","quantity": 5},{"productId": "0e131f46-8d1a-4761-9c83-b45ab5d3501e","variantId": 2}],"textLineItems": [{"name": {"en": "My shopping list item"},"description": {"en": "This is a good gift idea"},"quantity": 5}],"deleteDaysAfterLastModification": 100}
Get My ShoppingList
Get My ShoppingList by ID
Returns a ShoppingList for a given id
. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList exists for the given
id
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
expand | When expanding The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d","version": 1,"name": {"en": "test"},"key": "test","lineItems": [],"textLineItems": [],"createdAt": "2017-03-30T11:49:40.904Z","lastModifiedAt": "2017-03-30T11:49:40.904Z"}
Get My ShoppingList by Key
Returns a ShoppingList for a given key
. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList exists for the given
key
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
key String |
|
expand | When expanding The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d","version": 1,"name": {"en": "test"},"key": "test","lineItems": [],"textLineItems": [],"createdAt": "2017-03-30T11:49:40.904Z","lastModifiedAt": "2017-03-30T11:49:40.904Z"}
Get My ShoppingList in Store
Get My ShoppingList in Store by ID
Returns a ShoppingList for a given id
in a Store. Returns 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList matches the given
id
in a Store. - If a ShoppingList matches the given
id
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the given
id
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}:{storeKey}
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
id String |
|
expand | When expanding The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{id} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd","version": 1,"name": {"en": "My shopping list"},"key": "my-shopping-list","customer": {"typeId": "customer","id": "e73cd97f-846e-44a0-b418-3ed044a8e398"},"slug": {"en": "my-shopping-list"},"lineItems": [{"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5","productId": "077bb11b-0d00-4e00-aced-48f493a79da0","name": {"en": "Product name"},"productType": {"typeId": "product-type","id": "a941b0b1-5c8f-41de-99e4-de965714d89f"},"variantId": 2,"quantity": 1,"addedAt": "2022-08-22T14:11:03.572Z"}],"textLineItems": [{"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb","name": {"en": "My shopping list item"},"description": {"en": "This is a good gift idea"},"quantity": 5,"addedAt": "2022-08-22T14:11:03.572Z"}],"deleteDaysAfterLastModification": 100,"createdAt": "2022-08-22T14:11:03.587Z","lastModifiedAt": "2022-08-22T14:11:03.587Z"}
Get My ShoppingList in Store by Key
Returns a ShoppingList for a given key
in a Store. Returns 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList matches the given
key
in a Store. - If a ShoppingList matches the given
key
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the given
key
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
key String |
|
expand | When expanding The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={key} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd","version": 1,"name": {"en": "My shopping list"},"key": "my-shopping-list","customer": {"typeId": "customer","id": "e73cd97f-846e-44a0-b418-3ed044a8e398"},"slug": {"en": "my-shopping-list"},"lineItems": [{"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5","productId": "077bb11b-0d00-4e00-aced-48f493a79da0","name": {"en": "Product name"},"productType": {"typeId": "product-type","id": "a941b0b1-5c8f-41de-99e4-de965714d89f"},"variantId": 2,"quantity": 1,"addedAt": "2022-08-22T14:11:03.572Z"}],"textLineItems": [{"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb","name": {"en": "My shopping list item"},"description": {"en": "This is a good gift idea"},"quantity": 5,"addedAt": "2022-08-22T14:11:03.572Z"}],"deleteDaysAfterLastModification": 100,"createdAt": "2022-08-22T14:11:03.587Z","lastModifiedAt": "2022-08-22T14:11:03.587Z"}
Query My ShoppingLists
Returns all ShoppingLists that match the given Query Predicate. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList exists for the given Query Predicate.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
where | The parameter can be passed multiple times. |
/^var[.][a-zA-Z0-9]+$/ Any string parameter matching this regular expression | Predicate parameter values. The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | When expanding The parameter can be passed multiple times. |
limit Int | Number of results requested. |
offset Int | Number of elements skipped. |
withTotal Boolean | Controls the calculation of the total number of query results. Set to Default: true |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"limit": 20,"offset": 0,"count": 1,"total": 1,"results": [{"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d","version": 1,"name": {"en": "test"},"key": "test","lineItems": [],"textLineItems": [],"createdAt": "2017-03-30T11:49:40.904Z","lastModifiedAt": "2017-03-30T11:49:40.904Z"}]}
Query My ShoppingLists in Store
Returns ShoppingLists that match the given Query Predicate in a Store. Returns 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingLists exist in a Store.
- If a ShoppingList exists but does not have a
store
specified, or thestore
field references a different Store. - If a ShoppingList exists in a Store but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
where | The parameter can be passed multiple times. |
/^var[.][a-zA-Z0-9]+$/ Any string parameter matching this regular expression | Predicate parameter values. The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | When expanding The parameter can be passed multiple times. |
limit Int | Number of results requested. |
offset Int | Number of elements skipped. |
withTotal Boolean | Controls the calculation of the total number of query results. Set to Default: true |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"limit": 20,"offset": 0,"count": 1,"total": 1,"results": [{"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d","version": 1,"name": {"en": "test"},"key": "test","lineItems": [],"textLineItems": [],"createdAt": "2017-03-30T11:49:40.904Z","lastModifiedAt": "2017-03-30T11:49:40.904Z"}]}
Check if My ShoppingList exists
Check if My ShoppingList exists by ID
Checks if a ShoppingList exists for a given id
. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList exists for the given
id
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if My ShoppingList exists by Key
Checks if a ShoppingList exists for a given key
. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList exists for the given
key
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
key String |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if My ShoppingList exists by Query Predicate
Checks if a ShoppingList matches the given Query Predicate. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList exists for the given Query Predicate.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
where | The parameter can be passed multiple times. |
curl --head https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if My ShoppingList exists in Store
Check if My ShoppingList exists in Store by ID
Checks if a ShoppingList exists for a given id
in a Store. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList matches the given
id
in a Store. - If a ShoppingList matches the given
id
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the given
id
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}:{storeKey}
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
id String |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{id} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if My ShoppingList exists in Store by Key
Checks if a ShoppingList exists for a given key
in a Store. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList exists that matches the given
key
in a Store. - If a ShoppingList matches the given
key
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the given
key
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
key String |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={key} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if My ShoppingList exists in Store by Query Predicate
Checks if a ShoppingList exists for the given Query Predicate in a Store. Returns 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingLists exist for a given Query Predicate in a Store.
- If a ShoppingList matches the Query Predicate but does not have a
store
specified, or thestore
field references a different Store. - If a ShoppingList exists in a Store but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
where | The parameter can be passed multiple times. |
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
Create My ShoppingList
Creates a ShoppingList for the Customer or anonymous user. The customerId
or anonymousId
on the ShoppingList is automatically set based on the given customer:{id} or anonymous_id:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
expand | When expanding The parameter can be passed multiple times. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists -i \--header "Authorization: Bearer ${BEARER_TOKEN}" \--header 'Content-Type: application/json' \--data-binary @- << DATA{"name" : {"en" : "My shopping list"},"description" : {"en" : "Description of my shopping list"},"lineItems" : [ {"sku" : "product-variant-sku","quantity" : 5}, {"productId" : "0e131f46-8d1a-4761-9c83-b45ab5d3501e","variantId" : 2} ],"textLineItems" : [ {"name" : {"en" : "My shopping list item"},"description" : {"en" : "This is a good gift idea"},"quantity" : 5} ],"deleteDaysAfterLastModification" : 100}DATA
{"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d","version": 1,"name": {"en": "test"},"key": "test","lineItems": [],"textLineItems": [],"createdAt": "2017-03-30T11:49:40.904Z","lastModifiedAt": "2017-03-30T11:49:40.904Z"}
Create My ShoppingList in Store
Creates a ShoppingList in a Store for a Customer or anonymous user. The customer
or anonymousId
field on the ShoppingList is automatically set based on the given customer:{id} or anonymous_id:{id} scope.
When using this endpoint, the store
field of a ShoppingList is always set to the Store specified in the path parameter.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
expand | When expanding The parameter can be passed multiple times. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists -i \--header "Authorization: Bearer ${BEARER_TOKEN}" \--header 'Content-Type: application/json' \--data-binary @- << DATA{"name" : {"en" : "My shopping list"},"slug" : {"en" : "my-shopping-list"},"customer" : {"typeId" : "customer","id" : "e73cd97f-846e-44a0-b418-3ed044a8e398"},"key" : "my-shopping-list","deleteDaysAfterLastModification" : 100,"lineItems" : [ {"sku" : "product-variant-sku","quantity" : 5}, {"productId" : "0e131f46-8d1a-4761-9c83-b45ab5d3501e","variantId" : 2} ],"textLineItems" : [ {"name" : {"en" : "My shopping list item"},"description" : {"en" : "This is a good gift idea"},"quantity" : 5} ]}DATA
{"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd","version": 1,"name": {"en": "My shopping list"},"key": "my-shopping-list","customer": {"typeId": "customer","id": "e73cd97f-846e-44a0-b418-3ed044a8e398"},"slug": {"en": "my-shopping-list"},"lineItems": [{"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5","productId": "077bb11b-0d00-4e00-aced-48f493a79da0","name": {"en": "Product name"},"productType": {"typeId": "product-type","id": "a941b0b1-5c8f-41de-99e4-de965714d89f"},"variantId": 2,"quantity": 1,"addedAt": "2022-08-22T14:11:03.572Z"}],"textLineItems": [{"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb","name": {"en": "My shopping list item"},"description": {"en": "This is a good gift idea"},"quantity": 5,"addedAt": "2022-08-22T14:11:03.572Z"}],"deleteDaysAfterLastModification": 100,"createdAt": "2022-08-22T14:11:03.587Z","lastModifiedAt": "2022-08-22T14:11:03.587Z"}
Update My ShoppingList
Update My ShoppingList by ID
Updates a ShoppingList for a given id
. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList exists for the given
id
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
expand | When expanding The parameter can be passed multiple times. |
application/json
version Int | Expected version of the ShoppingList on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions Array of MyShoppingListUpdateAction | List of update actions to be performed on the ShoppingList. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id} -i \--header "Authorization: Bearer ${BEARER_TOKEN}" \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 1,"actions" : [ {"action" : "changeName","name" : {"en" : "My shopping list"}} ]}DATA
{"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d","version": 1,"name": {"en": "test"},"key": "test","lineItems": [],"textLineItems": [],"createdAt": "2017-03-30T11:49:40.904Z","lastModifiedAt": "2017-03-30T11:49:40.904Z"}
Update My ShoppingList by Key
Updates a ShoppingList for a given key
. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList exists for the given
key
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
key String |
|
expand | When expanding The parameter can be passed multiple times. |
application/json
version Int | Expected version of the ShoppingList on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions Array of MyShoppingListUpdateAction | List of update actions to be performed on the ShoppingList. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key} -i \--header "Authorization: Bearer ${BEARER_TOKEN}" \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 1,"actions" : [ {"action" : "changeName","name" : {"en" : "My shopping list"}} ]}DATA
{"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d","version": 1,"name": {"en": "test"},"key": "test","lineItems": [],"textLineItems": [],"createdAt": "2017-03-30T11:49:40.904Z","lastModifiedAt": "2017-03-30T11:49:40.904Z"}
Update My ShoppingList in Store
Update My ShoppingList in Store by ID
Updates a ShoppingList for a given id
in a Store. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList matches the given
id
in a Store. - If a ShoppingList matches the given
id
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the given
id
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
id String |
|
expand | When expanding The parameter can be passed multiple times. |
application/json
version Int | Expected version of the ShoppingList on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions Array of MyShoppingListUpdateAction | List of update actions to be performed on the ShoppingList. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{id} -i \--header "Authorization: Bearer ${BEARER_TOKEN}" \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 1,"actions" : [ {"action" : "changeName","name" : {"en" : "New Name"}} ]}DATA
{"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd","version": 1,"name": {"en": "My shopping list"},"key": "my-shopping-list","customer": {"typeId": "customer","id": "e73cd97f-846e-44a0-b418-3ed044a8e398"},"slug": {"en": "my-shopping-list"},"lineItems": [{"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5","productId": "077bb11b-0d00-4e00-aced-48f493a79da0","name": {"en": "Product name"},"productType": {"typeId": "product-type","id": "a941b0b1-5c8f-41de-99e4-de965714d89f"},"variantId": 2,"quantity": 1,"addedAt": "2022-08-22T14:11:03.572Z"}],"textLineItems": [{"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb","name": {"en": "My shopping list item"},"description": {"en": "This is a good gift idea"},"quantity": 5,"addedAt": "2022-08-22T14:11:03.572Z"}],"deleteDaysAfterLastModification": 100,"createdAt": "2022-08-22T14:11:03.587Z","lastModifiedAt": "2022-08-22T14:11:03.587Z"}
Update My ShoppingList in Store by Key
Updates a ShoppingList for a given key
in a Store. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList matches the given
key
in a Store. - If a ShoppingList matches the given
key
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the given
key
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
key String |
|
expand | When expanding The parameter can be passed multiple times. |
application/json
version Int | Expected version of the ShoppingList on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions Array of MyShoppingListUpdateAction | List of update actions to be performed on the ShoppingList. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={key} -i \--header "Authorization: Bearer ${BEARER_TOKEN}" \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 1,"actions" : [ {"action" : "changeName","name" : {"en" : "New Name"}} ]}DATA
{"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd","version": 1,"name": {"en": "My shopping list"},"key": "my-shopping-list","customer": {"typeId": "customer","id": "e73cd97f-846e-44a0-b418-3ed044a8e398"},"slug": {"en": "my-shopping-list"},"lineItems": [{"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5","productId": "077bb11b-0d00-4e00-aced-48f493a79da0","name": {"en": "Product name"},"productType": {"typeId": "product-type","id": "a941b0b1-5c8f-41de-99e4-de965714d89f"},"variantId": 2,"quantity": 1,"addedAt": "2022-08-22T14:11:03.572Z"}],"textLineItems": [{"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb","name": {"en": "My shopping list item"},"description": {"en": "This is a good gift idea"},"quantity": 5,"addedAt": "2022-08-22T14:11:03.572Z"}],"deleteDaysAfterLastModification": 100,"createdAt": "2022-08-22T14:11:03.587Z","lastModifiedAt": "2022-08-22T14:11:03.587Z"}
Update actions
Change Name
action String | "changeName" |
name | New value to set. Must not be empty. |
{"action": "changeName","name": {"de": "German name","en": "English name"}}
Set Description
action String | "setDescription" |
description | Value to set. If empty, any existing value will be removed. |
{"action": "setDescription","description": {"en": "New description","de": "Neue Beschreibung"}}
Set Custom Type
action String | "setCustomType" |
type | Defines the Type that extends the MyShoppingList with Custom Fields. If absent, any existing Type and Custom Fields are removed from the MyShoppingList. |
fields | Sets the Custom Fields fields for the MyShoppingList. |
{"action": "setCustomType","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringField": "TextString"}}
Set CustomField
action String | "setCustomField" |
name String | Name of the Custom Field. |
value | If |
{"action": "setCustomField","name": "exampleStringField","value": "TextString"}
Set DeleteDaysAfterLastModification
action String | "setDeleteDaysAfterLastModification" |
deleteDaysAfterLastModification Int | Value to set. If empty, any existing value will be removed. Minimum:1 |
{"action": "setDeleteDaysAfterLastModification","deleteDaysAfterLastModification": 10}
Update ShoppingListLineItems
Add ShoppingListLineItem
action String | "addLineItem" |
key String | User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList. MinLength:2 MaxLength: 256 Pattern: ^[a-zA-Z0-9_-] |
sku String |
|
productId String | Unique identifier of a Product. |
variantId Int |
|
quantity Int | Number of Products in the ShoppingListLineItem. |
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 ShoppingListLineItem. |
{"action": "addLineItem","productId": "{{product-id}}","variantId": 1,"quantity": 2}
Remove ShoppingListLineItem
action String | "removeLineItem" |
lineItemId String | The |
lineItemKey String | The |
quantity Int | Amount to remove from the 1 |
{"action": "removeLineItem","lineItemId": "{{lineItemId}}","quantity": 2}
Change ShoppingListLineItem Quantity
action String | "changeLineItemQuantity" |
lineItemId String |
|
lineItemKey String |
|
quantity Int | New value to set. If |
{"action": "changeLineItemQuantity","lineItemId": "{{lineItemId}}","quantity": 8}
Change ShoppingListLineItems Order
action String | "changeLineItemsOrder" |
lineItemOrder Array of String | All existing ShoppingListLineItem |
{"action": "changeLineItemsOrder","lineItemOrder": ["{{lineItemId2}}", "{{lineItemId}}"]}
Set ShoppingListLineItem Custom Type
action String | "setLineItemCustomType" |
lineItemId String | Unique identifier of an existing ShoppingListLineItem in the ShoppingList. |
type | Defines the Type that extends the ShoppingListLineItem with Custom Fields. If absent, any existing Type and Custom Fields are removed from the ShoppingListLineItem. |
fields | Sets the Custom Fields fields for the ShoppingListLineItem. |
{"action": "setLineItemCustomType","lineItemId": "{{lineItemId}}","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringField": "TextString"}}
Set ShoppingListLineItem CustomField
action String | "setLineItemCustomField" |
lineItemId String | Unique identifier of an the ShoppingListLineItem. Either |
lineItemKey String | The |
name String | Name of the Custom Field. |
value | If |
{"action": "setLineItemCustomField","lineItemId": "{{lineItemId}}","name": "exampleStringField","value": "TextString"}
Update TextLineItems
Add TextLineItem
action String | "addTextLineItem" |
key String | User-defined identifier of the TextLineItem. Must be unique per ShoppingList. MinLength:2 MaxLength: 256 Pattern: ^[a-zA-Z0-9_-] |
name | Name of the TextLineItem. |
description | Description of the TextLineItem. |
quantity Int | Number of entries in the 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. |
{"action": "addTextLineItem","name": {"de": "German name for text line item","en": "English name for text line item"}}
Remove TextLineItem
action String | "removeTextLineItem" |
textLineItemId String | The |
textLineItemKey String | The |
quantity Int | Amount to remove from the 1 |
{"action": "removeTextLineItem","textLineItemId": "{{lineItemId}}","quantity": 1}
Change TextLineItem Quantity
action String | "changeTextLineItemQuantity" |
textLineItemId String | The |
textLineItemKey String | The |
quantity Int | New value to set. If |
{"action": "changeTextLineItemQuantity","textLineItemId": "{{lineItemId}}","quantity": 1}
Change TextLineItem Name
action String | "changeTextLineItemName" |
textLineItemId String | The |
textLineItemKey String | The |
name | New value to set. Must not be empty. |
{"action": "changeTextLineItemName","textLineItemId": "{{lineItemId}}","name": {"de": "New German text line item name","en": "New English text line item name"}}
Set TextLineItem Description
action String | "setTextLineItemDescription" |
textLineItemId String | The |
textLineItemKey String | The |
description | Value to set. If empty, any existing value will be removed. |
{"action": "setTextLineItemDescription","textLineItemId": "{{lineItemId}}","description": {"en": "New description","de": "Neue Beschreibung"}}
Change TextLineItems Order
action String | "changeTextLineItemsOrder" |
textLineItemOrder Array of String | All existing TextLineItem |
{"action": "changeTextLineItemsOrder","textLineItemOrder": ["{{lineItemId2}}", "{{lineItemId}}"]}
Set TextLineItem Custom Type
action String | "setTextLineItemCustomType" |
textLineItemId String | The |
textLineItemKey String | The |
type | Defines the Type that extends the TextLineItem with Custom Fields. If absent, any existing Type and Custom Fields are removed from the TextLineItem. |
fields | Sets the Custom Fields fields for the TextLineItem. |
{"action": "setTextLineItemCustomType","textLineItemId": "{{lineItemId}}","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringField": "TextString"}}
Set TextLineItem CustomField
action String | "setTextLineItemCustomField" |
textLineItemId String | The |
textLineItemKey String | The |
name String | Name of the Custom Field. |
value | If |
{"action": "setTextLineItemCustomField","textLineItemId": "{{lineItemId}}","name": "exampleStringField","value": "TextString"}
Delete My ShoppingList
Delete My ShoppingList by ID
Deletes the ShoppingList for a given id
. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList exists for the given
id
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
version Int | Last seen version of the resource. |
expand | When expanding The parameter can be passed multiple times. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id}?version={version} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d","version": 1,"name": {"en": "test"},"key": "test","lineItems": [],"textLineItems": [],"createdAt": "2017-03-30T11:49:40.904Z","lastModifiedAt": "2017-03-30T11:49:40.904Z"}
Delete My ShoppingList by Key
Deletes the ShoppingList for a given key
. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList exists for the given
key
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
key String |
|
version Int | Last seen version of the resource. |
expand | When expanding The parameter can be passed multiple times. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key}?version={version} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d","version": 1,"name": {"en": "test"},"key": "test","lineItems": [],"textLineItems": [],"createdAt": "2017-03-30T11:49:40.904Z","lastModifiedAt": "2017-03-30T11:49:40.904Z"}
Delete My ShoppingList in Store
Delete My ShoppingList in Store by ID
Deletes the ShoppingList for a given id
in a Store. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList matches the given
id
in a Store. - If a ShoppingList matches the given
id
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the given
id
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
id String |
|
version Int | Last seen version of the resource. |
expand | When expanding The parameter can be passed multiple times. |
dataErasure Boolean | To erase all related personal data in compliance with GDPR, set to Default: false |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{id}?version={version} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd","version": 1,"name": {"en": "My shopping list"},"key": "my-shopping-list","customer": {"typeId": "customer","id": "e73cd97f-846e-44a0-b418-3ed044a8e398"},"slug": {"en": "my-shopping-list"},"lineItems": [{"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5","productId": "077bb11b-0d00-4e00-aced-48f493a79da0","name": {"en": "Product name"},"productType": {"typeId": "product-type","id": "a941b0b1-5c8f-41de-99e4-de965714d89f"},"variantId": 2,"quantity": 1,"addedAt": "2022-08-22T14:11:03.572Z"}],"textLineItems": [{"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb","name": {"en": "My shopping list item"},"description": {"en": "This is a good gift idea"},"quantity": 5,"addedAt": "2022-08-22T14:11:03.572Z"}],"deleteDaysAfterLastModification": 100,"createdAt": "2022-08-22T14:11:03.587Z","lastModifiedAt": "2022-08-22T14:11:03.587Z"}
Delete My ShoppingList in Store by Key
Deletes the ShoppingList for a given key
in a Store. Returns a 200 OK
status if successful.
A ResourceNotFound error is returned in the following scenarios:
- If no ShoppingList matches the given
key
in a Store. - If a ShoppingList matches the given
key
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the given
key
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
key String |
|
version Int | Last seen version of the resource. |
expand | When expanding The parameter can be passed multiple times. |
dataErasure Boolean | To erase all related personal data in compliance with GDPR, set to Default: false |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={key}?version={version} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd","version": 1,"name": {"en": "My shopping list"},"key": "my-shopping-list","customer": {"typeId": "customer","id": "e73cd97f-846e-44a0-b418-3ed044a8e398"},"slug": {"en": "my-shopping-list"},"lineItems": [{"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5","productId": "077bb11b-0d00-4e00-aced-48f493a79da0","name": {"en": "Product name"},"productType": {"typeId": "product-type","id": "a941b0b1-5c8f-41de-99e4-de965714d89f"},"variantId": 2,"quantity": 1,"addedAt": "2022-08-22T14:11:03.572Z"}],"textLineItems": [{"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb","name": {"en": "My shopping list item"},"description": {"en": "This is a good gift idea"},"quantity": 5,"addedAt": "2022-08-22T14:11:03.572Z"}],"deleteDaysAfterLastModification": 100,"createdAt": "2022-08-22T14:11:03.587Z","lastModifiedAt": "2022-08-22T14:11:03.587Z"}