Swap Cart Item Product

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 endpoint to get alternative product options for the current item. Or this endpoint 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

Request Body

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

CartItemResponse

CartProductOption

CartItemPrice

CartItemSource

CartProductQuantity

CombinedProductsInfo

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

Last updated