Representations
MyShoppingListDraft
customer
field of ShoppingList is automatically set with
a password flow token.
The anonymousId
is automatically set with a token for an anonymous session.
The key
and slug
fields can not be set.name ​ | Name of the ShoppingList. |
description ​ | Description of the ShoppingList. |
lineItems ​Array of ShoppingListLineItemDraft​ | Line Items (containing Products) to add to the ShoppingList. |
textLineItems ​Array of TextLineItemDraft​ | Line Items (containing text values) to add to the ShoppingList. |
deleteDaysAfterLastModification ​Int​ | Number of days after which the ShoppingList will be automatically deleted if it has not been modified. If not set, the default value configured in the Project is used. |
store ​ | Assigns the new ShoppingList to the Store. The Store assignment can not be modified. |
custom ​ | Custom Fields defined for the ShoppingList. |
{
"name": {
"en": "My shopping list"
},
"description": {
"en": "Description of my shopping list"
},
"lineItems": [
{
"sku": "product-variant-sku",
"quantity": 5
},
{
"productId": "0e131f46-8d1a-4761-9c83-b45ab5d3501e",
"variantId": 2
}
],
"textLineItems": [
{
"name": {
"en": "My shopping list item"
},
"description": {
"en": "This is a good gift idea"
},
"quantity": 5
}
],
"deleteDaysAfterLastModification": 100
}
Get My ShoppingList
Get My ShoppingList by ID
id
for the authenticated Customer or anonymous user. Returns a 200 OK
status if successful.- If no ShoppingList exists with the provided
id
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
id String ​ | id of the ShoppingList. |
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. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d",
"version": 1,
"name": {
"en": "test"
},
"key": "test",
"lineItems": [],
"textLineItems": [],
"createdAt": "2017-03-30T11:49:40.904Z",
"lastModifiedAt": "2017-03-30T11:49:40.904Z"
}
Get My ShoppingList by Key
key
for the authenticated Customer or anonymous user. Returns a 200 OK
status if successful.- If no ShoppingList exists with the provided
key
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
key String ​ | key of the ShoppingList. |
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. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d",
"version": 1,
"name": {
"en": "test"
},
"key": "test",
"lineItems": [],
"textLineItems": [],
"createdAt": "2017-03-30T11:49:40.904Z",
"lastModifiedAt": "2017-03-30T11:49:40.904Z"
}
Get My ShoppingList in Store
Get My ShoppingList in Store by ID
id
for the authenticated Customer or anonymous user in a Store. Returns 200 OK
status if successful.- If no ShoppingList matches the provided
id
in a Store. - If a ShoppingList matches the provided
id
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the provided
id
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}:{storeKey}
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
id String ​ | id of the ShoppingList. |
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. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd",
"version": 1,
"name": {
"en": "My shopping list"
},
"key": "my-shopping-list",
"customer": {
"typeId": "customer",
"id": "e73cd97f-846e-44a0-b418-3ed044a8e398"
},
"slug": {
"en": "my-shopping-list"
},
"lineItems": [
{
"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5",
"productId": "077bb11b-0d00-4e00-aced-48f493a79da0",
"name": {
"en": "Product name"
},
"productType": {
"typeId": "product-type",
"id": "a941b0b1-5c8f-41de-99e4-de965714d89f"
},
"variantId": 2,
"quantity": 1,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"textLineItems": [
{
"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb",
"name": {
"en": "My shopping list item"
},
"description": {
"en": "This is a good gift idea"
},
"quantity": 5,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"deleteDaysAfterLastModification": 100,
"createdAt": "2022-08-22T14:11:03.587Z",
"lastModifiedAt": "2022-08-22T14:11:03.587Z"
}
Get My ShoppingList in Store by Key
key
for the authenticated Customer or anonymous user in a Store. Returns 200 OK
status if successful.- If no ShoppingList matches the provided
key
in a Store. - If a ShoppingList matches the provided
key
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the provided
key
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
key String ​ | key of the ShoppingList. |
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. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd",
"version": 1,
"name": {
"en": "My shopping list"
},
"key": "my-shopping-list",
"customer": {
"typeId": "customer",
"id": "e73cd97f-846e-44a0-b418-3ed044a8e398"
},
"slug": {
"en": "my-shopping-list"
},
"lineItems": [
{
"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5",
"productId": "077bb11b-0d00-4e00-aced-48f493a79da0",
"name": {
"en": "Product name"
},
"productType": {
"typeId": "product-type",
"id": "a941b0b1-5c8f-41de-99e4-de965714d89f"
},
"variantId": 2,
"quantity": 1,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"textLineItems": [
{
"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb",
"name": {
"en": "My shopping list item"
},
"description": {
"en": "This is a good gift idea"
},
"quantity": 5,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"deleteDaysAfterLastModification": 100,
"createdAt": "2022-08-22T14:11:03.587Z",
"lastModifiedAt": "2022-08-22T14:11:03.587Z"
}
Query My ShoppingLists
200 OK
status if successful.- If no ShoppingList exists for the provided query predicate.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
where | 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 ​ | Number of results requested. Default: 20 ​Minimum: 0 ​Maximum: 500 ​ |
offset Int ​ | Number of elements skipped. Default: 0 ​Maximum: 10000 ​ |
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 ​ |
var.<varName> String ​ | Predicate parameter values. The parameter can be passed multiple times. |
ShoppingListPagedQueryResponse
asapplication/json
curl --get https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d",
"version": 1,
"name": {
"en": "test"
},
"key": "test",
"lineItems": [],
"textLineItems": [],
"createdAt": "2017-03-30T11:49:40.904Z",
"lastModifiedAt": "2017-03-30T11:49:40.904Z"
}
]
}
Query My ShoppingLists in Store
200 OK
status if successful.- If no ShoppingLists exist in a Store.
- If a ShoppingList exists but does not have a
store
specified, or thestore
field references a different Store. - If a ShoppingList exists in a Store but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
where | 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 ​ | Number of results requested. Default: 20 ​Minimum: 0 ​Maximum: 500 ​ |
offset Int ​ | Number of elements skipped. Default: 0 ​Maximum: 10000 ​ |
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 ​ |
var.<varName> String ​ | Predicate parameter values. The parameter can be passed multiple times. |
ShoppingListPagedQueryResponse
asapplication/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d",
"version": 1,
"name": {
"en": "test"
},
"key": "test",
"lineItems": [],
"textLineItems": [],
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"createdAt": "2017-03-30T11:49:40.904Z",
"lastModifiedAt": "2017-03-30T11:49:40.904Z"
}
]
}
Check if My ShoppingList exists
Check if My ShoppingList exists by ID
id
for the authenticated Customer or anonymous user. Returns a 200 OK
status if successful.- If no ShoppingList exists for the provided
id
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
id String ​ | id of the ShoppingList. |
curl --head https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if My ShoppingList exists by Key
key
for the authenticated Customer or anonymous user. Returns a 200 OK
status if successful.- If no ShoppingList exists with the provided
key
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
key String ​ | key of the ShoppingList. |
curl --head https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if My ShoppingList exists by Query Predicate
200 OK
status if successful.- If no ShoppingList exists for the provided query predicate.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
where | The parameter can be passed multiple times. |
curl --head https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if My ShoppingList exists in Store
Check if My ShoppingList exists in Store by ID
id
for the authenticated Customer or anonymous user in a Store. Returns a 200 OK
status if successful.- If no ShoppingList matches the provided
id
in a Store. - If a ShoppingList matches the provided
id
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the provided
id
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}:{storeKey}
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
id String ​ | id of the ShoppingList. |
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if My ShoppingList exists in Store by Key
key
for the authenticated Customer or anonymous user in a Store. Returns a 200 OK
status if successful.- If no ShoppingList exists that matches the provided
key
in a Store. - If a ShoppingList matches the provided
key
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the provided
key
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
key String ​ | key of the ShoppingList. |
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if My ShoppingList exists in Store by Query Predicate
200 OK
status if successful.- If no ShoppingLists exist for the provided query predicate in a Store.
- If a ShoppingList matches the query predicate but does not have a
store
specified, or thestore
field references a different Store. - If a ShoppingList exists in a Store but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
where | The parameter can be passed multiple times. |
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Create My ShoppingList
customerId
or anonymousId
on the ShoppingList is automatically set based on the given customer:{id} or anonymous_id:{id} scope.manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
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. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"name" : {
"en" : "My shopping list"
},
"description" : {
"en" : "Description of my shopping list"
},
"lineItems" : [ {
"sku" : "product-variant-sku",
"quantity" : 5
}, {
"productId" : "0e131f46-8d1a-4761-9c83-b45ab5d3501e",
"variantId" : 2
} ],
"textLineItems" : [ {
"name" : {
"en" : "My shopping list item"
},
"description" : {
"en" : "This is a good gift idea"
},
"quantity" : 5
} ],
"deleteDaysAfterLastModification" : 100
}
DATA
{
"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d",
"version": 1,
"name": {
"en": "test"
},
"key": "test",
"lineItems": [],
"textLineItems": [],
"createdAt": "2017-03-30T11:49:40.904Z",
"lastModifiedAt": "2017-03-30T11:49:40.904Z"
}
Create My ShoppingList in Store
customer
or anonymousId
field on the ShoppingList is automatically set based on the given customer:{id} or anonymous_id:{id} scope.store
field of a ShoppingList is always set to the Store specified in the path parameter.manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
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. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"name" : {
"en" : "My shopping list"
},
"slug" : {
"en" : "my-shopping-list"
},
"customer" : {
"typeId" : "customer",
"id" : "e73cd97f-846e-44a0-b418-3ed044a8e398"
},
"key" : "my-shopping-list",
"deleteDaysAfterLastModification" : 100,
"lineItems" : [ {
"sku" : "product-variant-sku",
"quantity" : 5
}, {
"productId" : "0e131f46-8d1a-4761-9c83-b45ab5d3501e",
"variantId" : 2
} ],
"textLineItems" : [ {
"name" : {
"en" : "My shopping list item"
},
"description" : {
"en" : "This is a good gift idea"
},
"quantity" : 5
} ],
"businessUnit" : {
"key" : "bu-345-france",
"typeId" : "business-unit"
}
}
DATA
{
"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd",
"version": 1,
"name": {
"en": "My shopping list"
},
"key": "my-shopping-list",
"customer": {
"typeId": "customer",
"id": "e73cd97f-846e-44a0-b418-3ed044a8e398"
},
"slug": {
"en": "my-shopping-list"
},
"lineItems": [
{
"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5",
"productId": "077bb11b-0d00-4e00-aced-48f493a79da0",
"name": {
"en": "Product name"
},
"productType": {
"typeId": "product-type",
"id": "a941b0b1-5c8f-41de-99e4-de965714d89f"
},
"variantId": 2,
"quantity": 1,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"textLineItems": [
{
"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb",
"name": {
"en": "My shopping list item"
},
"description": {
"en": "This is a good gift idea"
},
"quantity": 5,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"deleteDaysAfterLastModification": 100,
"createdAt": "2022-08-22T14:11:03.587Z",
"lastModifiedAt": "2022-08-22T14:11:03.587Z"
}
Update My ShoppingList
Update My ShoppingList by ID
200 OK
status if successful.- If no ShoppingList exists for the provided
id
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
id String ​ | id of the ShoppingList. |
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. |
application/json
version ​Int​ | Expected version of the ShoppingList on which the changes should be applied.
If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions ​Array of MyShoppingListUpdateAction​ | List of update actions to be performed on the ShoppingList. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "changeName",
"name" : {
"en" : "My shopping list"
}
} ]
}
DATA
{
"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d",
"version": 1,
"name": {
"en": "test"
},
"key": "test",
"lineItems": [],
"textLineItems": [],
"createdAt": "2017-03-30T11:49:40.904Z",
"lastModifiedAt": "2017-03-30T11:49:40.904Z"
}
Update My ShoppingList by Key
200 OK
status if successful.- If no ShoppingList exists for the provided
key
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
key String ​ | key of the ShoppingList. |
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. |
application/json
version ​Int​ | Expected version of the ShoppingList on which the changes should be applied.
If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions ​Array of MyShoppingListUpdateAction​ | List of update actions to be performed on the ShoppingList. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "changeName",
"name" : {
"en" : "My shopping list"
}
} ]
}
DATA
{
"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d",
"version": 1,
"name": {
"en": "test"
},
"key": "test",
"lineItems": [],
"textLineItems": [],
"createdAt": "2017-03-30T11:49:40.904Z",
"lastModifiedAt": "2017-03-30T11:49:40.904Z"
}
Update My ShoppingList in Store
Update My ShoppingList in Store by ID
200 OK
status if successful.- If no ShoppingList matches the provided
id
in a Store. - If a ShoppingList matches the provided
id
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the provided
id
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
id String ​ | id of the ShoppingList. |
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. |
application/json
version ​Int​ | Expected version of the ShoppingList on which the changes should be applied.
If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions ​Array of MyShoppingListUpdateAction​ | List of update actions to be performed on the ShoppingList. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "changeName",
"name" : {
"en" : "New Name"
}
} ]
}
DATA
{
"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd",
"version": 1,
"name": {
"en": "My shopping list"
},
"key": "my-shopping-list",
"customer": {
"typeId": "customer",
"id": "e73cd97f-846e-44a0-b418-3ed044a8e398"
},
"slug": {
"en": "my-shopping-list"
},
"lineItems": [
{
"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5",
"productId": "077bb11b-0d00-4e00-aced-48f493a79da0",
"name": {
"en": "Product name"
},
"productType": {
"typeId": "product-type",
"id": "a941b0b1-5c8f-41de-99e4-de965714d89f"
},
"variantId": 2,
"quantity": 1,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"textLineItems": [
{
"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb",
"name": {
"en": "My shopping list item"
},
"description": {
"en": "This is a good gift idea"
},
"quantity": 5,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"deleteDaysAfterLastModification": 100,
"createdAt": "2022-08-22T14:11:03.587Z",
"lastModifiedAt": "2022-08-22T14:11:03.587Z"
}
Update My ShoppingList in Store by Key
200 OK
status if successful.- If no ShoppingList matches the provided
key
in a Store. - If a ShoppingList matches the provided
key
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the provided
key
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
key String ​ | key of the ShoppingList. |
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. |
application/json
version ​Int​ | Expected version of the ShoppingList on which the changes should be applied.
If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions ​Array of MyShoppingListUpdateAction​ | List of update actions to be performed on the ShoppingList. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "changeName",
"name" : {
"en" : "New Name"
}
} ]
}
DATA
{
"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd",
"version": 1,
"name": {
"en": "My shopping list"
},
"key": "my-shopping-list",
"customer": {
"typeId": "customer",
"id": "e73cd97f-846e-44a0-b418-3ed044a8e398"
},
"slug": {
"en": "my-shopping-list"
},
"lineItems": [
{
"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5",
"productId": "077bb11b-0d00-4e00-aced-48f493a79da0",
"name": {
"en": "Product name"
},
"productType": {
"typeId": "product-type",
"id": "a941b0b1-5c8f-41de-99e4-de965714d89f"
},
"variantId": 2,
"quantity": 1,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"textLineItems": [
{
"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb",
"name": {
"en": "My shopping list item"
},
"description": {
"en": "This is a good gift idea"
},
"quantity": 5,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"deleteDaysAfterLastModification": 100,
"createdAt": "2022-08-22T14:11:03.587Z",
"lastModifiedAt": "2022-08-22T14:11:03.587Z"
}
Update actions
Change Name
action ​String​ | "changeName" |
name ​ | New value to set. Must not be empty. |
{
"action": "changeName",
"name": {
"de": "German name",
"en": "English name"
}
}
Set Description
action ​String​ | "setDescription" |
description ​ | Value to set. If empty, any existing value will be removed. |
{
"action": "setDescription",
"description": {
"en": "New description",
"de": "Neue Beschreibung"
}
}
Set Custom Type
action ​String​ | "setCustomType" |
type ​ | Defines the Type that extends the MyShoppingList with Custom Fields.
If absent, any existing Type and Custom Fields are removed from the MyShoppingList. |
fields ​ | Sets the Custom Fields fields for the MyShoppingList. |
{
"action": "setCustomType",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}
Set CustomField
action ​String​ | "setCustomField" |
name ​String​ | Name of the Custom Field. |
value ​ | If 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 . |
{
"action": "setCustomField",
"name": "exampleStringField",
"value": "TextString"
}
Set DeleteDaysAfterLastModification
action ​String​ | "setDeleteDaysAfterLastModification" |
deleteDaysAfterLastModification ​Int​ | Value to set. If empty, any existing value will be removed. Minimum:Â1 ​ |
{
"action": "setDeleteDaysAfterLastModification",
"deleteDaysAfterLastModification": 10
}
Update ShoppingListLineItems
Add ShoppingListLineItem
action ​String​ | "addLineItem" |
key ​String​ | User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList. MinLength: 2 ​MaxLength: 256 ​Pattern: ^[a-zA-Z0-9_-] ​ |
sku ​String​ | 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 ​DateTime​ | Date and time the TextLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used. |
custom ​ | Custom Fields defined for the ShoppingListLineItem. |
{
"action": "addLineItem",
"productId": "{{product-id}}",
"variantId": 1,
"quantity": 2
}
Remove ShoppingListLineItem
action ​String​ | "removeLineItem" |
lineItemId ​String​ | |
lineItemKey ​String​ | |
quantity ​Int​ | Amount to remove from the Minimum: 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.1 ​ |
{
"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 Minimum: 0 , the ShoppingListLineItem is removed from the ShoppingList.0 ​ |
{
"action": "changeLineItemQuantity",
"lineItemId": "{{lineItemId}}",
"quantity": 8
}
Change ShoppingListLineItems Order
action ​String​ | "changeLineItemsOrder" |
lineItemOrder ​Array of String​ |
{
"action": "changeLineItemsOrder",
"lineItemOrder": [
"{{lineItemId2}}",
"{{lineItemId}}"
]
}
Set ShoppingListLineItem Custom Type
action ​String​ | "setLineItemCustomType" |
lineItemId ​String​ | Unique identifier of an existing ShoppingListLineItem in the ShoppingList. |
type ​ | Defines the Type that extends the ShoppingListLineItem with Custom Fields.
If absent, any existing Type and Custom Fields are removed from the ShoppingListLineItem. |
fields ​ | Sets the Custom Fields fields for the ShoppingListLineItem. |
{
"action": "setLineItemCustomType",
"lineItemId": "{{lineItemId}}",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}
Set ShoppingListLineItem CustomField
action ​String​ | "setLineItemCustomField" |
lineItemId ​String​ | |
lineItemKey ​String​ | |
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 . |
{
"action": "setLineItemCustomField",
"lineItemId": "{{lineItemId}}",
"name": "exampleStringField",
"value": "TextString"
}
Update TextLineItems
Add TextLineItem
action ​String​ | "addTextLineItem" |
key ​String​ | User-defined identifier of the TextLineItem. Must be unique per ShoppingList. MinLength: 2 ​MaxLength: 256 ​Pattern: ^[a-zA-Z0-9_-] ​ |
name ​ | Name of the TextLineItem. |
description ​ | Description of the TextLineItem. |
quantity ​Int​ | Number of entries in the TextLineItem. |
addedAt ​DateTime​ | Date and time the TextLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used. |
custom ​ | Custom Fields defined for the TextLineItem. |
{
"action": "addTextLineItem",
"name": {
"de": "German name for text line item",
"en": "English name for text line item"
}
}
Remove TextLineItem
action ​String​ | "removeTextLineItem" |
textLineItemId ​String​ | |
textLineItemKey ​String​ | |
quantity ​Int​ | Amount to remove from the Minimum: 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.1 ​ |
{
"action": "removeTextLineItem",
"textLineItemId": "{{lineItemId}}",
"quantity": 1
}
Change TextLineItem Quantity
action ​String​ | "changeTextLineItemQuantity" |
textLineItemId ​String​ | |
textLineItemKey ​String​ | |
quantity ​Int​ | New value to set. If Minimum: 0 , the TextLineItem is removed from the ShoppingList.0 ​ |
{
"action": "changeTextLineItemQuantity",
"textLineItemId": "{{lineItemId}}",
"quantity": 1
}
Change TextLineItem Name
action ​String​ | "changeTextLineItemName" |
textLineItemId ​String​ | |
textLineItemKey ​String​ | |
name ​ | New value to set. Must not be empty. |
{
"action": "changeTextLineItemName",
"textLineItemId": "{{lineItemId}}",
"name": {
"de": "New German text line item name",
"en": "New English text line item name"
}
}
Set TextLineItem Description
action ​String​ | "setTextLineItemDescription" |
textLineItemId ​String​ | |
textLineItemKey ​String​ | |
description ​ | Value to set. If empty, any existing value will be removed. |
{
"action": "setTextLineItemDescription",
"textLineItemId": "{{lineItemId}}",
"description": {
"en": "New description",
"de": "Neue Beschreibung"
}
}
Change TextLineItems Order
action ​String​ | "changeTextLineItemsOrder" |
textLineItemOrder ​Array of String​ | All existing TextLineItem id s in the desired new order. |
{
"action": "changeTextLineItemsOrder",
"textLineItemOrder": [
"{{lineItemId2}}",
"{{lineItemId}}"
]
}
Set TextLineItem Custom Type
action ​String​ | "setTextLineItemCustomType" |
textLineItemId ​String​ | |
textLineItemKey ​String​ | |
type ​ | Defines the Type that extends the TextLineItem with Custom Fields.
If absent, any existing Type and Custom Fields are removed from the TextLineItem. |
fields ​ | Sets the Custom Fields fields for the TextLineItem. |
{
"action": "setTextLineItemCustomType",
"textLineItemId": "{{lineItemId}}",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}
Set TextLineItem CustomField
action ​String​ | "setTextLineItemCustomField" |
textLineItemId ​String​ | |
textLineItemKey ​String​ | |
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 . |
{
"action": "setTextLineItemCustomField",
"textLineItemId": "{{lineItemId}}",
"name": "exampleStringField",
"value": "TextString"
}
Delete My ShoppingList
Delete My ShoppingList by ID
200 OK
status if successful.- If no ShoppingList exists with the provided
id
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
id String ​ | id of the ShoppingList. |
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. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/{id}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d",
"version": 1,
"name": {
"en": "test"
},
"key": "test",
"lineItems": [],
"textLineItems": [],
"createdAt": "2017-03-30T11:49:40.904Z",
"lastModifiedAt": "2017-03-30T11:49:40.904Z"
}
Delete My ShoppingList by Key
200 OK
status if successful.- If no ShoppingList exists for the provided
key
. - If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
key String ​ | key of the ShoppingList. |
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. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/me/shopping-lists/key={key}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "9693f04b-5aec-467f-baa1-fc74da7d0c3d",
"version": 1,
"name": {
"en": "test"
},
"key": "test",
"lineItems": [],
"textLineItems": [],
"createdAt": "2017-03-30T11:49:40.904Z",
"lastModifiedAt": "2017-03-30T11:49:40.904Z"
}
Delete My ShoppingList in Store
Delete My ShoppingList in Store by ID
200 OK
status if successful.- If no ShoppingList matches the provided
id
in a Store. - If a ShoppingList matches the provided
id
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the provided
id
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
id String ​ | id of the ShoppingList. |
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 ​ |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/{id}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd",
"version": 1,
"name": {
"en": "My shopping list"
},
"key": "my-shopping-list",
"customer": {
"typeId": "customer",
"id": "e73cd97f-846e-44a0-b418-3ed044a8e398"
},
"slug": {
"en": "my-shopping-list"
},
"lineItems": [
{
"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5",
"productId": "077bb11b-0d00-4e00-aced-48f493a79da0",
"name": {
"en": "Product name"
},
"productType": {
"typeId": "product-type",
"id": "a941b0b1-5c8f-41de-99e4-de965714d89f"
},
"variantId": 2,
"quantity": 1,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"textLineItems": [
{
"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb",
"name": {
"en": "My shopping list item"
},
"description": {
"en": "This is a good gift idea"
},
"quantity": 5,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"deleteDaysAfterLastModification": 100,
"createdAt": "2022-08-22T14:11:03.587Z",
"lastModifiedAt": "2022-08-22T14:11:03.587Z"
}
Delete My ShoppingList in Store by Key
200 OK
status if successful.- If no ShoppingList matches the provided
key
in a Store. - If a ShoppingList matches the provided
key
but does not have astore
specified, or thestore
field references a different Store. - If a ShoppingList matches the provided
key
in a Store but does not contain either ananonymousId
that matches the anonymous_id:{id} scope, or acustomer
withid
value that matches the customer:{id} scope.
manage_my_shopping_lists:{projectKey}
manage_my_shopping_lists:{projectKey}:{storeKey}
customer_id:{id}
anonymous_id:{id}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
key String ​ | key of the ShoppingList. |
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 ​ |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/shopping-lists/key={key}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "acb58513-ccfd-4ee8-8f28-9b7238fb91cd",
"version": 1,
"name": {
"en": "My shopping list"
},
"key": "my-shopping-list",
"customer": {
"typeId": "customer",
"id": "e73cd97f-846e-44a0-b418-3ed044a8e398"
},
"slug": {
"en": "my-shopping-list"
},
"lineItems": [
{
"id": "ade85d60-736b-4ca8-87ed-01fde78f92c5",
"productId": "077bb11b-0d00-4e00-aced-48f493a79da0",
"name": {
"en": "Product name"
},
"productType": {
"typeId": "product-type",
"id": "a941b0b1-5c8f-41de-99e4-de965714d89f"
},
"variantId": 2,
"quantity": 1,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"textLineItems": [
{
"id": "c25aaca9-bb25-4a9f-bb1f-be0a78e98dcb",
"name": {
"en": "My shopping list item"
},
"description": {
"en": "This is a good gift idea"
},
"quantity": 5,
"addedAt": "2022-08-22T14:11:03.572Z"
}
],
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"deleteDaysAfterLastModification": 100,
"createdAt": "2022-08-22T14:11:03.587Z",
"lastModifiedAt": "2022-08-22T14:11:03.587Z"
}