BETA

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
}
Clipboard icon

Get ShoppingList

Get ShoppingList by ID

GET
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id}
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}
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:
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
Clipboard icon
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"
}
Clipboard icon

Get ShoppingList by Key

GET
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key}
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}
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:
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
Clipboard icon
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"
}
Clipboard icon

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}

If a ShoppingList exists in a Project but does not have the store field, or the store field references a different Store, the ResourceNotFound error is returned.

OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}:{storeKey}, manage_my_shopping_lists:{projectKey}
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:
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}'
Clipboard icon
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"
}
Clipboard icon

Get ShoppingList in Store by Key

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

If a ShoppingList exists in a Project but does not have the store field, or the store field references a different Store, the ResourceNotFound error is returned.

OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}, manage_my_shopping_lists:{projectKey}:{storeKey}
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:
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}'
Clipboard icon
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"
}
Clipboard icon

Query ShoppingLists

GET
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}
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.

Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
Clipboard icon
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"
} ]
}
Clipboard icon

Query ShoppingLists in Store

GET
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}, manage_my_shopping_lists:{projectKey}:{storeKey}
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.

Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
Clipboard icon
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"
} ]
}
Clipboard icon

Create ShoppingList

POST
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}
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
Clipboard icon
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"
}
Clipboard icon

Create ShoppingList in Store

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

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}
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
Clipboard icon
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"
}
Clipboard icon

Update ShoppingList

Update ShoppingList by ID

POST
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id}
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}
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 409 Conflict 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
Clipboard icon
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"
}
Clipboard icon

Update ShoppingList by Key

POST
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key}
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}
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 409 Conflict 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
Clipboard icon
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"
}
Clipboard icon

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}

If a ShoppingList exists in a Project but does not have the store field, or the store field references a different Store, the ResourceNotFound error is returned.

OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}, manage_my_shopping_lists:{projectKey}:{storeKey}
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 409 Conflict 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
Clipboard icon
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"
}
Clipboard icon

Update ShoppingList in Store by Key

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

If a ShoppingList exists in a Project but does not have the store field, or the store field references a different Store, the ResourceNotFound error is returned.

OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}, manage_my_shopping_lists:{projectKey}:{storeKey}
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 409 Conflict 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
Clipboard icon
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"
}
Clipboard icon

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"
}
}
Clipboard icon

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"
}
}
Clipboard icon

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"
}
}
Clipboard icon

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"
}
Clipboard icon

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
}
Clipboard icon

Update ShoppingListLineItems

Add ShoppingListLineItem

action
String
"addLineItem"
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
}
Clipboard icon

Remove ShoppingListLineItem

action
String
"removeLineItem"
lineItemId
String

The id of the ShoppingListLineItem to update.

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
}
Clipboard icon

Change ShoppingListLineItem Quantity

action
String
"changeLineItemQuantity"
lineItemId
String

The id of the ShoppingListLineItem to update.

quantity
Int

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

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

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}}" ]
}
Clipboard icon

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"
}
}
Clipboard icon

Set ShoppingListLineItem CustomField

action
String
"setLineItemCustomField"
lineItemId
String

Unique identifier of an existing ShoppingListLineItem in the ShoppingList.

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"
}
Clipboard icon

Update TextLineItems

Add TextLineItem

action
String
"addTextLineItem"
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"
}
}
Clipboard icon

Remove TextLineItem

action
String
"removeTextLineItem"
textLineItemId
String

The id of the TextLineItem to update.

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
}
Clipboard icon

Change TextLineItem Quantity

action
String
"changeTextLineItemQuantity"
textLineItemId
String

The id of the TextLineItem to update.

quantity
Int

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

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

Change TextLineItem Name

action
String
"changeTextLineItemName"
textLineItemId
String

The id of the TextLineItem to update.

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"
}
}
Clipboard icon

Set TextLineItem Description

action
String
"setTextLineItemDescription"
textLineItemId
String

The id of the TextLineItem to update.

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"
}
}
Clipboard icon

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}}" ]
}
Clipboard icon

Set TextLineItem Custom Type

action
String
"setTextLineItemCustomType"
textLineItemId
String

The id of the TextLineItem to update.

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"
}
}
Clipboard icon

Set TextLineItem CustomField

action
String
"setTextLineItemCustomField"
textLineItemId
String

The id of the TextLineItem to update.

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"
}
Clipboard icon

Delete ShoppingList

Delete ShoppingList by ID

DELETE
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id}
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}
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:
Request Example:cURL
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id}?version={version} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'
Clipboard icon
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"
}
Clipboard icon

Delete ShoppingList by Key

DELETE
https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key}
OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}
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:
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}'
Clipboard icon
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"
}
Clipboard icon

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}

If a ShoppingList exists in a Project but does not have the store field, or the store field references a different Store, the ResourceNotFound error is returned.

OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}, manage_my_shopping_lists:{projectKey}:{storeKey}
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

Defaults to false. Set to true if you want to erase all related personal data in compliance with GDPR.

Response:
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}'
Clipboard icon
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"
}
Clipboard icon

Delete ShoppingList in Store by Key

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

If a ShoppingList exists in a Project but does not have the store field, or the store field references a different Store, the ResourceNotFound error is returned.

OAuth 2.0 Scopes:
manage_my_shopping_lists:{projectKey}, manage_my_shopping_lists:{projectKey}:{storeKey}
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

Defaults to false. Set to true if you want to erase all related personal data in compliance with GDPR.

Response:
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}'
Clipboard icon
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"
}
Clipboard icon