[go: up one dir, main page]

Associate Shopping Lists

Associate Shopping Lists allow Associates to interact with Shopping Lists on behalf of a Business Unit.
Associates can view, create, update, and delete Shopping Lists on behalf of a Business Unit. The actions a given Associate is allowed to perform depends on the specific roles and permissions they hold within the Business Unit.

Get ShoppingList in BusinessUnit as Associate

The Associate must have the ViewMyShoppingLists or ViewOthersShoppingLists Permission. If the required Permission is missing, an AssociateMissingPermission error is returned.

Get ShoppingList in BusinessUnit by ID as Associate

GET
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists/{id}
Retrieves a ShoppingList with the provided key in a BusinessUnit.
If the ShoppingList exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.
OAuth 2.0 Scopes:
view_shopping_lists:{projectKey}
Path parameters:
region
String
Region in which the Project is hosted.
projectKey
String
key of the Project.
associateId
String
id of the Customer who is acting on behalf of the BusinessUnit.
businessUnitKey
String
key of the BusinessUnit.
id
String
id of the ShoppingList.
Query parameters:
expand
When expanding variant and productSlug on ShoppingListLineItem, expand the entire array; you cannot expand only a single element of the array—for example, expand=lineItems[0].variant is not supported.
The parameter can be passed multiple times.
Response:
200

ShoppingList

as
application/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/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",
      "published": true,
      "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 ShoppingList in BusinessUnit by Key as Associate

GET
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists/key={key}
Retrieves a ShoppingList with the provided key in a BusinessUnit. If the ShoppingList exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.
OAuth 2.0 Scopes:
view_shopping_lists:{projectKey}
Path parameters:
region
String
Region in which the Project is hosted.
projectKey
String
key of the Project.
associateId
String
id of the Customer who is acting on behalf of the BusinessUnit.
businessUnitKey
String
key of the BusinessUnit.
key
String
key of the ShoppingList.
Query parameters:
expand
When expanding variant and productSlug on ShoppingListLineItem, expand the entire array; you cannot expand only a single element of the array—for example, expand=lineItems[0].variant is not supported.
The parameter can be passed multiple times.
Response:
200

ShoppingList

as
application/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/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",
      "published": true,
      "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 ShoppingLists in BusinessUnit as Associate

GET
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists
Retrieves ShoppingLists in a BusinessUnit.
OAuth 2.0 Scopes:
view_shopping_lists:{projectKey}
Path parameters:
region
String
Region in which the Project is hosted.
projectKey
String
key of the Project.
associateId
String
id of the Customer who is acting on behalf of the BusinessUnit.
businessUnitKey
String
key of the BusinessUnit.
Query parameters:
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 only a single element of the array—for example, expand=lineItems[0].variant is not supported.
The parameter can be passed multiple times.
limit
Int
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
The parameter can be passed multiple times.
Response:
200

ShoppingListPagedQueryResponse

as
application/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/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": [],
      "businessUnit": {
        "key": "bu-345-france",
        "typeId": "business-unit"
      },
      "createdAt": "2017-03-30T11:49:40.904Z",
      "lastModifiedAt": "2017-03-30T11:49:40.904Z"
    }
  ]
}

Check if ShoppingList exists in BusinessUnit as Associate

Whether a Shopping List is visible to the Associate depends on their role and the associated Permissions.

Check if ShoppingList exists in BusinessUnit by ID as Associate

HEAD
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists/{id}
Checks if a ShoppingList exists with the provided id in a BusinessUnit. Returns a 200 status if the ShoppingList exists, or a 404 status otherwise.
OAuth 2.0 Scopes:
view_shopping_lists:{projectKey}
Path parameters:
region
String
Region in which the Project is hosted.
projectKey
String
key of the Project.
associateId
String
id of the Customer who is acting on behalf of the BusinessUnit.
businessUnitKey
String
key of the BusinessUnit.
id
String
id of the ShoppingList.
Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" 

Check if ShoppingList exists in BusinessUnit by Key as Associate

HEAD
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists/key={key}
Checks if a ShoppingList exists with the provided key in a BusinessUnit. Returns a 200 status if the ShoppingList exists, or a 404 status otherwise.
OAuth 2.0 Scopes:
view_shopping_lists:{projectKey}
Path parameters:
region
String
Region in which the Project is hosted.
projectKey
String
key of the Project.
associateId
String
id of the Customer who is acting on behalf of the BusinessUnit.
businessUnitKey
String
key of the BusinessUnit.
key
String
key of the ShoppingList.
Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" 

Check if ShoppingList exists in BusinessUnit by Query Predicate as Associate

HEAD
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists
Checks if one or more ShoppingLists exist for the provided query predicate in a BusinessUnit. Returns a 200 status if any ShoppingLists match the query predicate, or a 404 status otherwise.
OAuth 2.0 Scopes:
view_shopping_lists:{projectKey}
Path parameters:
region
String
Region in which the Project is hosted.
projectKey
String
key of the Project.
associateId
String
id of the Customer who is acting on behalf of the BusinessUnit.
businessUnitKey
String
key of the BusinessUnit.
Query parameters:
where
The parameter can be passed multiple times.
Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" 

Create ShoppingList in BusinessUnit as Associate

The Associate must have the CreateMyShoppingLists or CreateOthersShoppingLists Permission. If the required Permission is missing, an AssociateMissingPermission error is returned.
POST
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists
Creates a ShoppingList in the BusinessUnit referenced by businessUnitKey. As such, the businessUnit field on ShoppingListDraft is ignored for this request.
OAuth 2.0 Scopes:
manage_shopping_lists:{projectKey}
Path parameters:
region
String
Region in which the Project is hosted.
projectKey
String
key of the Project.
associateId
String
id of the Customer who is acting on behalf of the BusinessUnit.
businessUnitKey
String
key of the BusinessUnit.
Query parameters:
expand
When expanding variant and productSlug on ShoppingListLineItem, expand the entire array; you cannot expand only a single element of the array—for example, expand=lineItems[0].variant is not supported.
The parameter can be passed multiple times.
Request Body:ShoppingListDraftasapplication/json
Response:
201

ShoppingList

as
application/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/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
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",
      "published": true,
      "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 ShoppingList in BusinessUnit as Associate

The Associate must have the UpdateMyShoppingLists or UpdateOthersShoppingLists Permission. If the required Permission is missing, an AssociateMissingPermission error is returned.

Update ShoppingList in BusinessUnit by ID as Associate

POST
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists/{id}
Updates a ShoppingList in a BusinessUnit using one or more update actions. If the ShoppingList exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.
OAuth 2.0 Scopes:
manage_shopping_lists:{projectKey}
Path parameters:
region
String
Region in which the Project is hosted.
projectKey
String
key of the Project.
associateId
String
id of the Customer who is acting on behalf of the BusinessUnit.
businessUnitKey
String
key of the BusinessUnit.
id
String
id of the ShoppingList.
Query parameters:
expand
When expanding variant and productSlug on ShoppingListLineItem, expand the entire array; you cannot expand only a single element of the array—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

List of update actions to be performed on the ShoppingList.

Response:
200

ShoppingList

as
application/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/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",
      "published": true,
      "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 ShoppingList in BusinessUnit by Key as Associate

POST
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists/key={key}
Updates a ShoppingList in a BusinessUnit using one or more update actions. If the ShoppingList exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.
OAuth 2.0 Scopes:
manage_shopping_lists:{projectKey}
Path parameters:
region
String
Region in which the Project is hosted.
projectKey
String
key of the Project.
associateId
String
id of the Customer who is acting on behalf of the BusinessUnit.
businessUnitKey
String
key of the BusinessUnit.
key
String
key of the ShoppingList.
Query parameters:
expand
When expanding variant and productSlug on ShoppingListLineItem, expand the entire array; you cannot expand only a single element of the array—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

List of update actions to be performed on the ShoppingList.

Response:
200

ShoppingList

as
application/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/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",
      "published": true,
      "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 ShoppingList in BusinessUnit as Associate

The Associate must have the DeleteMyShoppingLists or DeleteOthersShoppingLists Permission. If the required Permission is missing, an AssociateMissingPermission error is returned.

Delete ShoppingList in BusinessUnit by ID as Associate

DELETE
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists/{id}
Deletes a ShoppingList in a BusinessUnit.
If the ShoppingList exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.
OAuth 2.0 Scopes:
manage_shopping_lists:{projectKey}
Path parameters:
region
String
Region in which the Project is hosted.
projectKey
String
key of the Project.
associateId
String
id of the Customer who is acting on behalf of the BusinessUnit.
businessUnitKey
String
key of the BusinessUnit.
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 only a single element of the array—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:
200

ShoppingList

as
application/json
Request Example:cURL
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/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",
      "published": true,
      "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 ShoppingList in BusinessUnit by Key as Associate

DELETE
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/shopping-lists/key={key}
Deletes a ShoppingList in a BusinessUnit.
If the ShoppingList exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.
OAuth 2.0 Scopes:
manage_shopping_lists:{projectKey}
Path parameters:
region
String
Region in which the Project is hosted.
projectKey
String
key of the Project.
associateId
String
id of the Customer who is acting on behalf of the BusinessUnit.
businessUnitKey
String
key of the BusinessUnit.
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 only a single element of the array—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:
200

ShoppingList

as
application/json
Request Example:cURL
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/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",
      "published": true,
      "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"
}