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

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.

Assigns the new ShoppingList to the Store. The Store assignment can not be modified.

custom

Custom Fields defined for the ShoppingList.

Example: json
{
"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 ShoppingList

Get ShoppingList by ID

GET
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

id
String

id of the ShoppingList.

Query parameters:
expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Response:
200ShoppingListasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
200 Response Example: ShoppingListjson
{
"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 ShoppingList by Key

GET
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

key
String

key of the ShoppingList.

Query parameters:
expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Response:
200ShoppingListasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
200 Response Example: ShoppingListjson
{
"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 ShoppingList in Store

Get ShoppingList in Store by ID

GET
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{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 a store specified, or the store field references a different Store.
  • If a ShoppingList matches the given id in a Store but does not contain either an anonymousId that matches the anonymous_id:{id} scope, or a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}:{storeKey}manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

id
String

id of the ShoppingList.

Query parameters:
expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Response:
200ShoppingListasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{id} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
200 Response Example: ShoppingListjson
{
"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 ShoppingList in Store by Key

GET
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={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 a store specified, or the store field references a different Store.
  • If a ShoppingList matches the given key in a Store but does not contain either an anonymousId that matches the anonymous_id:{id} scope, or a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

key
String

key of the ShoppingList.

Query parameters:
expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Response:
200ShoppingListasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={key} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
200 Response Example: ShoppingListjson
{
"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 ShoppingLists

GET
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists

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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

Query parameters:
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 variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
limit
Int
offset
Int

Number of elements skipped.

withTotal
Boolean

Controls the calculation of the total number of query results. Set to false to improve query performance when the total is not needed.

Default: true
Response:
200ShoppingListPagedQueryResponseasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
200 Response Example: ShoppingListPagedQueryResponsejson
{
"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 ShoppingLists in Store

GET
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists

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 the store 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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

Query parameters:
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 variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
limit
Int
offset
Int

Number of elements skipped.

withTotal
Boolean

Controls the calculation of the total number of query results. Set to false to improve query performance when the total is not needed.

Default: true
Response:
200ShoppingListPagedQueryResponseasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
200 Response Example: ShoppingListPagedQueryResponsejson
{
"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 ShoppingList exists

Check if ShoppingList exists by ID

HEAD
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

id
String

id of the ShoppingList.

Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'

Check if ShoppingList exists by Key

HEAD
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

key
String

key of the ShoppingList.

Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'

Check if ShoppingList exists by Query Predicate

HEAD
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists

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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

Query parameters:
where
The parameter can be passed multiple times.
Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'

Check if ShoppingList exists in Store

Check if ShoppingList exists in Store by ID

HEAD
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{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 a store specified, or the store field references a different Store.
  • If a ShoppingList matches the given id in a Store but does not contain either an anonymousId that matches the anonymous_id:{id} scope, or a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}:{storeKey}manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

id
String

id of the ShoppingList.

Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{id} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'

Check if ShoppingList exists in Store by Key

HEAD
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={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 a store specified, or the store field references a different Store.
  • If a ShoppingList matches the given key in a Store but does not contain either an anonymousId that matches the anonymous_id:{id} scope, or a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

key
String

key of the ShoppingList.

Response:
200
Request Example:cURL
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 ShoppingList exists in Store by Query Predicate

HEAD
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists

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 the store 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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

Query parameters:
where
The parameter can be passed multiple times.
Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'

Create ShoppingList

POST
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists

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.

OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

Query parameters:
expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Request Body:MyShoppingListDraftasapplication/json
Response:
201ShoppingListasapplication/json
Request Example:cURL
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
201 Response Example: ShoppingListjson
{
"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 ShoppingList in Store

POST
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists

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.

OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

Query parameters:
expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Request Body:MyShoppingListDraftasapplication/json
Response:
201ShoppingListasapplication/json
Request Example:cURL
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
201 Response Example: ShoppingListjson
{
"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 ShoppingList

Update ShoppingList by ID

POST
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

id
String

id of the ShoppingList.

Query parameters:
expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Request Body:
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.

Response:
200ShoppingListasapplication/json
Request Example:cURL
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
200 Response Example: ShoppingListjson
{
"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 ShoppingList by Key

POST
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

key
String

key of the ShoppingList.

Query parameters:
expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Request Body:
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.

Response:
200ShoppingListasapplication/json
Request Example:cURL
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
200 Response Example: ShoppingListjson
{
"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 ShoppingList in Store

Update ShoppingList in Store by ID

POST
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{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 a store specified, or the store field references a different Store.
  • If a ShoppingList matches the given id in a Store but does not contain either an anonymousId that matches the anonymous_id:{id} scope, or a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

id
String

id of the ShoppingList.

Query parameters:
expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Request Body:
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.

Response:
200ShoppingListasapplication/json
Request Example:cURL
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
200 Response Example: ShoppingListjson
{
"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 ShoppingList in Store by Key

POST
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={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 a store specified, or the store field references a different Store.
  • If a ShoppingList matches the given key in a Store but does not contain either an anonymousId that matches the anonymous_id:{id} scope, or a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

key
String

key of the ShoppingList.

Query parameters:
expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Request Body:
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.

Response:
200ShoppingListasapplication/json
Request Example:cURL
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
200 Response Example: ShoppingListjson
{
"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.

Example: json
{
"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.

Example: json
{
"action": "setDescription",
"description": {
"en": "New description",
"de": "Neue Beschreibung"
}
}

Set Custom Type

action
String
"setCustomType"

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.

Example: json
{
"action": "setCustomType",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringTypeField": "TextString"
}
}

Set CustomField

action
String
"setCustomField"
name
String

Name of the Custom Field.

value

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.

Example: json
{
"action": "setCustomField",
"name": "ExampleStringTypeField",
"value": "TextString"
}

Set DeleteDaysAfterLastModification

action
String
"setDeleteDaysAfterLastModification"
deleteDaysAfterLastModification
Int

Value to set. If empty, any existing value will be removed.

Minimum: 1
Example: json
{
"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: 2MaxLength: 256Pattern: ^[a-zA-Z0-9_-]
sku
String

sku of the ProductVariant.

productId
String

Unique identifier of a Product.

variantId
Int

id of the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.

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.

Example: json
{
"action": "addLineItem",
"productId": "{{product-id}}",
"variantId": 1,
"quantity": 2
}

Remove ShoppingListLineItem

action
String
"removeLineItem"
lineItemId
String

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

quantity
Int

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.

Minimum: 1
Example: json
{
"action": "removeLineItem",
"lineItemId": "{{lineItemId}}",
"quantity": 2
}

Change ShoppingListLineItem Quantity

action
String
"changeLineItemQuantity"
lineItemId
String

id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

quantity
Int

New value to set. If 0, the ShoppingListLineItem is removed from the ShoppingList.

Example: json
{
"action": "changeLineItemQuantity",
"lineItemId": "{{lineItemId}}",
"quantity": 8
}

Change ShoppingListLineItems Order

action
String
"changeLineItemsOrder"
lineItemOrder
Array of String

All existing ShoppingListLineItem ids of the ShoppingList in the desired new order.

Example: json
{
"action": "changeLineItemsOrder",
"lineItemOrder": ["{{lineItemId2}}", "{{lineItemId}}"]
}

Set ShoppingListLineItem Custom Type

action
String
"setLineItemCustomType"
lineItemId
String

Unique identifier of an existing ShoppingListLineItem in the ShoppingList.

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.

Example: json
{
"action": "setLineItemCustomType",
"lineItemId": "{{lineItemId}}",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringTypeField": "TextString"
}
}

Set ShoppingListLineItem CustomField

action
String
"setLineItemCustomField"
lineItemId
String

Unique identifier of an the ShoppingListLineItem. Either lineItemId or lineItemKey is required.

lineItemKey
String

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

name
String

Name of the Custom Field.

value

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.

Example: json
{
"action": "setLineItemCustomField",
"lineItemId": "{{lineItemId}}",
"name": "ExampleStringTypeField",
"value": "TextString"
}

Update TextLineItems

Add TextLineItem

action
String
"addTextLineItem"
key
String

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.

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.

Example: json
{
"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 id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

textLineItemKey
String

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

quantity
Int

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.

Minimum: 1
Example: json
{
"action": "removeTextLineItem",
"textLineItemId": "{{lineItemId}}",
"quantity": 1
}

Change TextLineItem Quantity

action
String
"changeTextLineItemQuantity"
textLineItemId
String

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

textLineItemKey
String

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

quantity
Int

New value to set. If 0, the TextLineItem is removed from the ShoppingList.

Example: json
{
"action": "changeTextLineItemQuantity",
"textLineItemId": "{{lineItemId}}",
"quantity": 1
}

Change TextLineItem Name

action
String
"changeTextLineItemName"
textLineItemId
String

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

textLineItemKey
String

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

name

New value to set. Must not be empty.

Example: json
{
"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 id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

textLineItemKey
String

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

description

Value to set. If empty, any existing value will be removed.

Example: json
{
"action": "setTextLineItemDescription",
"textLineItemId": "{{lineItemId}}",
"description": {
"en": "New description",
"de": "Neue Beschreibung"
}
}

Change TextLineItems Order

action
String
"changeTextLineItemsOrder"
textLineItemOrder
Array of String

All existing TextLineItem ids in the desired new order.

Example: json
{
"action": "changeTextLineItemsOrder",
"textLineItemOrder": ["{{lineItemId2}}", "{{lineItemId}}"]
}

Set TextLineItem Custom Type

action
String
"setTextLineItemCustomType"
textLineItemId
String

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

textLineItemKey
String

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

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.

Example: json
{
"action": "setTextLineItemCustomType",
"textLineItemId": "{{lineItemId}}",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringTypeField": "TextString"
}
}

Set TextLineItem CustomField

action
String
"setTextLineItemCustomField"
textLineItemId
String

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

textLineItemKey
String

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

name
String

Name of the Custom Field.

value

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.

Example: json
{
"action": "setTextLineItemCustomField",
"textLineItemId": "{{lineItemId}}",
"name": "ExampleStringTypeField",
"value": "TextString"
}

Delete ShoppingList

Delete ShoppingList by ID

DELETE
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

id
String

id of the ShoppingList.

Query parameters:
version
Int

Last seen version of the resource.

expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Response:
200ShoppingListasapplication/json
Request Example:cURL
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id}?version={version} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
200 Response Example: ShoppingListjson
{
"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 ShoppingList by Key

DELETE
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={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 a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

key
String

key of the ShoppingList.

Query parameters:
version
Int

Last seen version of the resource.

expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
Response:
200ShoppingListasapplication/json
Request Example:cURL
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key}?version={version} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
200 Response Example: ShoppingListjson
{
"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 ShoppingList in Store

Delete ShoppingList in Store by ID

DELETE
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{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 a store specified, or the store field references a different Store.
  • If a ShoppingList matches the given id in a Store but does not contain either an anonymousId that matches the anonymous_id:{id} scope, or a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

id
String

id of the ShoppingList.

Query parameters:
version
Int

Last seen version of the resource.

expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
dataErasure
Boolean

To erase all related personal data in compliance with GDPR, set to true.

Default: false
Response:
200ShoppingListasapplication/json
Request Example:cURL
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}'
200 Response Example: ShoppingListjson
{
"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 ShoppingList in Store by Key

DELETE
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={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 a store specified, or the store field references a different Store.
  • If a ShoppingList matches the given key in a Store but does not contain either an anonymousId that matches the anonymous_id:{id} scope, or a customer with id value that matches the customer:{id} scope.
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}manage_my_shopping_lists:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

key
String

key of the ShoppingList.

Query parameters:
version
Int

Last seen version of the resource.

expand

When expanding variant and productSlug on ShoppingListLineItem, expand the entire array. You cannot expand a single element (for example, expand=lineItems[0].variant is not supported).

The parameter can be passed multiple times.
dataErasure
Boolean

To erase all related personal data in compliance with GDPR, set to true.

Default: false
Response:
200ShoppingListasapplication/json
Request Example:cURL
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}'
200 Response Example: ShoppingListjson
{
"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"
}