Swap Cart Item Product

You can use this API to change matched product for cart item. It can be usefull if user want to choose another item or item was not matched.

Use this endpoint to get alterative product options for current item.
Or this endpoint to find alterative by string.

POST
/v1beta/:cart_id/items/:item_id/swap

Parameters

ATTRIBUTETYPEDESCRIPTION
cart_id*string

unique cart id

item_id*string

unique item id

newItemStoreItemValue

New product for cart item

StoreItemValue

ATTRIBUTETYPEDESCRIPTION
sku*string

item identifier in Retailer

quantityinteger

number of items to checkout

Default value: 1
sourceCartItemSource

source for store product

Sample Request

curl -X POST "https://graph.whisk.com/v1beta/:id/items" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Token Access-Token>" \ -d '{ "newItem": { "sku": "278837857", "quantity": 1 } }'

CartItemResponse

ATTRIBUTETYPEDESCRIPTION
id*string

unique cart item identifier

sourceList*array [CartItemSource]

list of original ingredients related to current item

productCartProductOption

store item

combinedarray [CombinedProductsInfo]

information about combined items, if items was combined by similar product

analysisobject

Analysis for cart item (category, product canonical name)

CartProductOption

ATTRIBUTETYPEDESCRIPTION
sku*string

store item identifier

name*string

store item name

quantity*CartProductQuantity

quantity of product items

price CartItemPrice

price for the quantity of products

images*array [ImageContainer]
urlstring

link to product page in store

CartItemPrice

ATTRIBUTETYPEDESCRIPTION
list*double

list price

CartItemSource

ATTRIBUTETYPEDESCRIPTION
name*string

source item text

groupIdstring

group identifier

CartProductQuantity

ATTRIBUTETYPEDESCRIPTION
count*integer

number of items

CombinedProductsInfo

ATTRIBUTETYPEDESCRIPTION
name*string

name of combined items

Sample Response

{ "id": "d57471c6de434340bd600d6b93f7b77c", "sourceList": [ { "name": "eggs" } ], "product": { "sku": "278837857", "name": "Dr.Oetker Egg White Powder Multipack Sach4x5g", "quantity": { "count": 1 }, "price": { "list": 1.2 }, "images": [ { "url": "https://img.tesco.com/Groceries/pi/303/5000254019303/IDShot_540x540.jpg" } ], "url": "https://www.tesco.com/groceries/en-GB/products/278837857" } }