This feature is marked as beta and may be affected by changes. Use with caution for production.

Shopping Lists

A shopping list can be used to implement a “save-for-later” feature for an individual customer, a shareable wishlist, or a public collection of products. Shopping lists hold line items of products in the platform or any other items that can be described as text.

Representations

All representations are JSON objects submitted or received as payload to API requests or responses.

ShoppingList

ShoppingListDraft

A ShoppingListDraft is the object submitted as payload to a Create ShoppingList method.

LineItem

A line item is a reference to a ProductVariant in a Product in its current version.

In addition to the standard reference expansion, a line item offers custom expansions (also defined with the query parameter expand).
When using those custom expansion, the following fields are available:

LineItemDraft

TextLineItem

TextLineItemDraft

Get ShoppingList

Get ShoppingList by Id

Gets a shopping list by Id.

Endpoint: /{projectKey}/shopping-lists/{id}
Method: GET
OAuth2 Scopes: view_shopping_lists:{projectKey}
Response Representation: ShoppingList

Get ShoppingList by Key

Gets a shopping list by Key.

Endpoint: /{projectKey}/shopping-lists/key={key}
Method: GET
OAuth2 Scopes: view_shopping_lists:{projectKey}
Response Representation: ShoppingList

Query ShoppingLists

Endpoint: /{projectKey}/shopping-lists
Method: GET
OAuth2 Scopes: view_shopping_lists:{projectKey}
Response Representation: PagedQueryResult with the results array of ShoppingList
Query Parameters:

Create ShoppingList

Endpoint: /{projectKey}/shopping-lists
Method: POST
OAuth2 Scopes: manage_shopping_lists:{projectKey}
Request Representation: ShoppingListDraft
Response Representation: ShoppingList

Update ShoppingList

Update ShoppingList by Id

Endpoint: /{projectKey}/shopping-lists/{id}
Method: POST
OAuth2 Scopes: manage_shopping_lists:{projectKey}
Response Representation: ShoppingList
Fields:

Update ShoppingList by Key

Update a shopping list found by its Key.

Endpoint: /{projectKey}/shopping-lists/key={key}
Method: POST
OAuth2 Scopes: manage_shopping_lists:{projectKey}
Response Representation: ShoppingList
Fields:

Update Actions
Please find below the individual update actions provided on this endpoint.


Set Key

Set Slug

Change Name

Set Description

Set Customer

Set Custom Type

This action sets, overwrites or removes any existing custom type and fields for an existing shopping list.

Set CustomField

This action sets, overwrites or removes any existing custom field for an existing shopping list.

UpdateAction on line item

Add LineItem

Adds a line item for a product variant to the shopping list.
If the shopping list already contains a line item for the same product variant with the same custom fields, then only the quantity of existing the LineItem is increased.
a line item with an empty variant id is not considered the same as a line item with a variant id currently referring the master variant

Remove LineItem

Decreases the quantity of the given LineItem.
If the quantity is absent or the updated quantity is less than 1, the line item is removed from the shopping list.

Change LineItem Quantity

Sets the quantity of the given LineItem.
If quantity is 0, the line item is removed from the shopping list.

Change LineItems Order

Set LineItem Custom Type

This action sets, overwrites or removes the custom type and fields for an existing LineItem.

Set LineItem CustomField

This action sets, overwrites or removes any existing custom field for an existing LineItem.

UpdateAction on TextLineItem

Add TextLineItem

Remove TextLineItem

Decreases the quantity of the given TextLineItem.
If after the update the quantity of the text line item is not greater than 0 or the quantity is not specified, the text line item is removed from the shopping list.

Change TextLineItem Quantity

Sets the quantity of the given TextLineItem.
If quantity is 0, the text line item is removed from the shopping list.

Change TextLineItem Name

Set TextLineItem Description

Change TextLineItems Order

Set TextLineItems Custom Type

This action sets, overwrites or removes the custom type and fields for an existing TextLineItem.

Set TextLineItems CustomField

This action sets, overwrites or removes any existing custom field for an existing TextLineItem.

Set DeleteDaysAfterLastModification

Sets deleteDaysAfterLastModification. The shopping list will be deleted automatically if it hasn’t been modified for the specified amount of days.

Delete ShoppingList

Delete ShoppingList by Id

Delete a ShoppingList found by its Id.

Endpoint: /{projectKey}/shopping-lists/{id}
Method: DELETE
OAuth2 Scopes: manage_shopping_lists:{projectKey}
Response Representation: ShoppingList
Query parameters:

Delete ShoppingList by Key

Delete a ShoppingList found by its Key.

Endpoint: /{projectKey}/shopping-lists/key={key}
Method: DELETE
OAuth2 Scopes: manage_shopping_lists:{projectKey}
Response Representation: ShoppingList
Query parameters:

comments powered by Disqus