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. |
lineItemsArray of ShoppingListLineItemDraft | Line Items (containing Products) to add to the ShoppingList. |
textLineItemsArray of TextLineItemDraft | Line Items (containing text values) to add to the ShoppingList. |
deleteDaysAfterLastModificationInt | 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
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
expand | When expanding The parameter can be passed multiple times. |
application/jsoncurl --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
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
expand | When expanding The parameter can be passed multiple times. |
application/jsoncurl --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
idin a Store. - If a ShoppingList matches the given
idbut does not have astorespecified, or thestorefield references a different Store. - If a ShoppingList matches the given
idin a Store but does not contain either ananonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}:{storeKey}manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
idString |
|
expand | When expanding The parameter can be passed multiple times. |
application/jsoncurl --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"}],"businessUnit": {"key": "bu-345-france","typeId": "business-unit"},"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
keyin a Store. - If a ShoppingList matches the given
keybut does not have astorespecified, or thestorefield references a different Store. - If a ShoppingList matches the given
keyin a Store but does not contain either ananonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
keyString |
|
expand | When expanding The parameter can be passed multiple times. |
application/jsoncurl --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"}],"businessUnit": {"key": "bu-345-france","typeId": "business-unit"},"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
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
where | 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. |
limitInt | Number of results requested. Default: 20 |
offsetInt | Number of elements skipped. Default: 0 |
withTotalBoolean | Controls the calculation of the total number of query results. Set to Default: true |
var.<varName>String | Predicate parameter values. The parameter can be passed multiple times. |
application/jsoncurl --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
storespecified, or thestorefield references a different Store. - If a ShoppingList exists in a Store but does not contain either an
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
where | 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. |
limitInt | Number of results requested. Default: 20 |
offsetInt | Number of elements skipped. Default: 0 |
withTotalBoolean | Controls the calculation of the total number of query results. Set to Default: true |
var.<varName>String | Predicate parameter values. The parameter can be passed multiple times. |
application/jsoncurl --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": [],"businessUnit": {"key": "bu-345-france","typeId": "business-unit"},"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
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
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
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
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
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
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
idin a Store. - If a ShoppingList matches the given
idbut does not have astorespecified, or thestorefield references a different Store. - If a ShoppingList matches the given
idin a Store but does not contain either ananonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}:{storeKey}manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
idString |
|
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
keyin a Store. - If a ShoppingList matches the given
keybut does not have astorespecified, or thestorefield references a different Store. - If a ShoppingList matches the given
keyin a Store but does not contain either ananonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
keyString |
|
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
storespecified, or thestorefield references a different Store. - If a ShoppingList exists in a Store but does not contain either an
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
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}regionString | Region in which the Project is hosted. |
projectKeyString |
|
expand | When expanding The parameter can be passed multiple times. |
application/jsonapplication/jsoncurl 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}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
expand | When expanding The parameter can be passed multiple times. |
application/jsonapplication/jsoncurl 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} ],"businessUnit" : {"key" : "bu-345-france","typeId" : "business-unit"}}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"}],"businessUnit": {"key": "bu-345-france","typeId": "business-unit"},"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
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
expand | When expanding The parameter can be passed multiple times. |
application/jsonversionInt | 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. |
actionsArray of MyShoppingListUpdateAction | List of update actions to be performed on the ShoppingList. |
application/jsoncurl 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
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
expand | When expanding The parameter can be passed multiple times. |
application/jsonversionInt | 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. |
actionsArray of MyShoppingListUpdateAction | List of update actions to be performed on the ShoppingList. |
application/jsoncurl 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
idin a Store. - If a ShoppingList matches the given
idbut does not have astorespecified, or thestorefield references a different Store. - If a ShoppingList matches the given
idin a Store but does not contain either ananonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
idString |
|
expand | When expanding The parameter can be passed multiple times. |
application/jsonversionInt | 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. |
actionsArray of MyShoppingListUpdateAction | List of update actions to be performed on the ShoppingList. |
application/jsoncurl 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"}],"businessUnit": {"key": "bu-345-france","typeId": "business-unit"},"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
keyin a Store. - If a ShoppingList matches the given
keybut does not have astorespecified, or thestorefield references a different Store. - If a ShoppingList matches the given
keyin a Store but does not contain either ananonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
keyString |
|
expand | When expanding The parameter can be passed multiple times. |
application/jsonversionInt | 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. |
actionsArray of MyShoppingListUpdateAction | List of update actions to be performed on the ShoppingList. |
application/jsoncurl 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"}],"businessUnit": {"key": "bu-345-france","typeId": "business-unit"},"deleteDaysAfterLastModification": 100,"createdAt": "2022-08-22T14:11:03.587Z","lastModifiedAt": "2022-08-22T14:11:03.587Z"}
Update actions
Change Name
actionString | "changeName" |
name | New value to set. Must not be empty. |
{"action": "changeName","name": {"de": "German name","en": "English name"}}
Set Description
actionString | "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
actionString | "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
actionString | "setCustomField" |
nameString | Name of the Custom Field. |
value | If |
{"action": "setCustomField","name": "exampleStringField","value": "TextString"}
Set DeleteDaysAfterLastModification
actionString | "setDeleteDaysAfterLastModification" |
deleteDaysAfterLastModificationInt | Value to set. If empty, any existing value will be removed. Minimum:1 |
{"action": "setDeleteDaysAfterLastModification","deleteDaysAfterLastModification": 10}
Update ShoppingListLineItems
Add ShoppingListLineItem
actionString | "addLineItem" |
keyString | User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList. MinLength:2MaxLength: 256Pattern: ^[a-zA-Z0-9_-] |
skuString |
|
productIdString | Unique identifier of a Product. |
variantIdInt |
|
quantityInt | 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
actionString | "removeLineItem" |
lineItemIdString | The |
lineItemKeyString | The |
quantityInt | Amount to remove from the 1 |
{"action": "removeLineItem","lineItemId": "{{lineItemId}}","quantity": 2}
Change ShoppingListLineItem Quantity
actionString | "changeLineItemQuantity" |
lineItemIdString |
|
lineItemKeyString |
|
quantityInt | New value to set. If |
{"action": "changeLineItemQuantity","lineItemId": "{{lineItemId}}","quantity": 8}
Change ShoppingListLineItems Order
actionString | "changeLineItemsOrder" |
lineItemOrderArray of String | All existing ShoppingListLineItem |
{"action": "changeLineItemsOrder","lineItemOrder": ["{{lineItemId2}}", "{{lineItemId}}"]}
Set ShoppingListLineItem Custom Type
actionString | "setLineItemCustomType" |
lineItemIdString | 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
actionString | "setLineItemCustomField" |
lineItemIdString | Unique identifier of an the ShoppingListLineItem. Either |
lineItemKeyString | The |
nameString | Name of the Custom Field. |
value | If |
{"action": "setLineItemCustomField","lineItemId": "{{lineItemId}}","name": "exampleStringField","value": "TextString"}
Update TextLineItems
Add TextLineItem
actionString | "addTextLineItem" |
keyString | User-defined identifier of the TextLineItem. Must be unique per ShoppingList. MinLength:2MaxLength: 256Pattern: ^[a-zA-Z0-9_-] |
name | Name of the TextLineItem. |
description | Description of the TextLineItem. |
quantityInt | 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
actionString | "removeTextLineItem" |
textLineItemIdString | The |
textLineItemKeyString | The |
quantityInt | Amount to remove from the 1 |
{"action": "removeTextLineItem","textLineItemId": "{{lineItemId}}","quantity": 1}
Change TextLineItem Quantity
actionString | "changeTextLineItemQuantity" |
textLineItemIdString | The |
textLineItemKeyString | The |
quantityInt | New value to set. If |
{"action": "changeTextLineItemQuantity","textLineItemId": "{{lineItemId}}","quantity": 1}
Change TextLineItem Name
actionString | "changeTextLineItemName" |
textLineItemIdString | The |
textLineItemKeyString | 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
actionString | "setTextLineItemDescription" |
textLineItemIdString | The |
textLineItemKeyString | 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
actionString | "changeTextLineItemsOrder" |
textLineItemOrderArray of String | All existing TextLineItem |
{"action": "changeTextLineItemsOrder","textLineItemOrder": ["{{lineItemId2}}", "{{lineItemId}}"]}
Set TextLineItem Custom Type
actionString | "setTextLineItemCustomType" |
textLineItemIdString | The |
textLineItemKeyString | 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
actionString | "setTextLineItemCustomField" |
textLineItemIdString | The |
textLineItemKeyString | The |
nameString | 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
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
versionInt | Last seen version of the resource. |
expand | When expanding The parameter can be passed multiple times. |
application/jsoncurl -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
anonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
versionInt | Last seen version of the resource. |
expand | When expanding The parameter can be passed multiple times. |
application/jsoncurl -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
idin a Store. - If a ShoppingList matches the given
idbut does not have astorespecified, or thestorefield references a different Store. - If a ShoppingList matches the given
idin a Store but does not contain either ananonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
idString |
|
versionInt | Last seen version of the resource. |
expand | When expanding The parameter can be passed multiple times. |
dataErasureBoolean | To erase all related personal data in compliance with GDPR, set to Default: false |
application/jsoncurl -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"}],"businessUnit": {"key": "bu-345-france","typeId": "business-unit"},"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
keyin a Store. - If a ShoppingList matches the given
keybut does not have astorespecified, or thestorefield references a different Store. - If a ShoppingList matches the given
keyin a Store but does not contain either ananonymousIdthat matches the anonymous_id:{id} scope, or acustomerwithidvalue that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
keyString |
|
versionInt | Last seen version of the resource. |
expand | When expanding The parameter can be passed multiple times. |
dataErasureBoolean | To erase all related personal data in compliance with GDPR, set to Default: false |
application/jsoncurl -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"}],"businessUnit": {"key": "bu-345-france","typeId": "business-unit"},"deleteDaysAfterLastModification": 100,"createdAt": "2022-08-22T14:11:03.587Z","lastModifiedAt": "2022-08-22T14:11:03.587Z"}