Whisk Docs
Whisk HomeHelp CenterDeveloper Tools
v1.0.0
v1.0.0
  • Overview
  • Guides
    • Creating An Account
    • Getting Started
    • Whisk Sandbox
  • API
    • Authentication
      • Server Token
      • Client Token
      • User Access Token
      • Anonymous Access
    • Recipes
      • Get Recipe
      • Get Recipe Categories
      • Recipe Objects
    • Recipe Discovery
      • Recipe Feed
      • Recipe Search
      • Get Similar Recipes
    • Shopping Lists
      • Get Shopping Lists
      • Create A Shopping List
      • Add Items To A Shopping List
      • List Analysis
    • Meal Plans
      • Meal Plan Management
      • Delete Meals
      • Auto-Generator
      • Error Handling
    • Retailers
      • Get Available Stores
      • Retailers Checkout Flow
      • Retailer Aliases
      • OAuth Retailer Flow
      • Retailer User Info
      • Search Store Items
    • Carts
      • Create a Cart
      • Update Cart Item
      • Splitting Combined Items
      • Add Items To Cart
      • Add Recipes To Cart
      • Get Cart Item Options
      • Swap Cart Item Product
      • Delete A Cart Or A Cart Item
      • Checkout
    • Users
      • Get A User
      • Update A User
    • User Recipes & Collections
      • Add User Recipe
      • Create A Recipe
      • Update External Recipe
      • Get All User Recipes
      • Update User Recipe
      • Remove Recipe from Favorites
      • Create Collection
      • Get All User Collections
      • Get Collection
      • Get Recipes from a Collection
      • Remove Collection
    • Tools
      • Autocomplete
  • Shopping List SDK
    • Overview
    • Examples
      • Shoppable Recipes
      • Shoppable Products
      • Shoppable Media
    • Basic Setup
      • Basic Setup
      • Methods
      • Event Listeners
      • Widget
      • Subscriptions
      • Global Configuration
      • UTM Parameters
      • Using With SPA
  • Shopping List Mobile API
    • Overview
    • Examples
    • Reference
  • Tips and Tricks
    • Object IDs
    • URL Lookup
    • Searching
    • Multiple IDs request
  • Resources
    • Nutrients
    • Recipe Labels
    • Health Score, Glycemic Index, Glycemic Load
    • Whisk User Data
    • Supported Retailers
    • Optimizing Image Load
Powered by GitBook
On this page
  • Swap Cart Item Product
  • StoreItemValue
  • CartItemResponse
  • CartProductOption
  • CartItemPrice
  • CartItemSource
  • CartProductQuantity
  • CombinedProductsInfo
  • Sample Request
  • Sample Response

Was this helpful?

  1. API
  2. Carts

Swap Cart Item Product

PreviousGet Cart Item OptionsNextDelete A Cart Or A Cart Item

Last updated 5 years ago

Was this helpful?

You can use this API to change the matched products for cart items. It can be useful if the user wants to choose another item or item that was not matched.

Use this to get alternative product options for the current item. Or this to find an alternative by a string.

Swap Cart Item Product

POST https://graph.whisk.com/v1/:cart_id/items/:item_id/swap

Path Parameters

Name
Type
Description

cart_id

string

Unique cart identifier

item_id

string

Unique item identifier

Request Body

Name
Type
Description

newItem

object

The new product for the cart item - StoreItemValue object

{
  "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"
  }
}

StoreItemValue

ATTRIBUTE

TYPE

DESCRIPTION

sku*

string

item identifier in Retailer

quantity

integer

number of items to checkout Default value: 1

source

CartItemSource

source for store product

CartItemResponse

ATTRIBUTE

TYPE

DESCRIPTION

id*

string

unique cart item identifier

sourceList*

array [CartItemSource]

list of original ingredients related to the current item

product

CartProductOption

store item

combined

array [CombinedProductsInfo]

information about combined items, if items were combined by a similar product

analysis

object

Analysis for cart item (category, product canonical name)

CartProductOption

ATTRIBUTE

TYPE

DESCRIPTION

sku*

string

store item identifier

name*

string

store item name

quantity*

CartProductQuantity

quantity of product items

price

CartItemPrice

price for the number of products

images*

array [ImageContainer]

url

string

link to product page in store

CartItemPrice

ATTRIBUTE

TYPE

DESCRIPTION

list*

double

list price

CartItemSource

ATTRIBUTE

TYPE

DESCRIPTION

name*

string

source item text

groupId

string

group identifier

CartProductQuantity

ATTRIBUTE

TYPE

DESCRIPTION

count*

integer

number of items

CombinedProductsInfo

ATTRIBUTE

TYPE

DESCRIPTION

name*

string

name of combined items

Sample Request

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

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"
  }
}
endpoint
endpoint