Edit Cart: eventCartItemEdit

The Edit Cart event API captures modifications to the items in the customer's shopping cart. This includes changes to product quantities, prices, and other relevant details. The data helps businesses understand how customers adjust their selections before proceeding to checkout.

API Endpoint and Method

URL

Copy
https://rcdp-us-east-1.algonomy.com/callback/rest/events/{APP_API_KEY}/eventCartItemEdit

Example URL

Copy
https://rcdp-us-east-1.algonomy.com/callback/rest/events/BESQILOBZCGHVLZTCNTGJMYGQEARWVZVCUPYVUGNCZPJRSUDAR/eventCartItemEdit

HTTP Method

POST

Parameters

Parameter

Type Required or Optional

Description

cartProducts

Object

Required

The details of the products in the cart (see sub-parameters below).

cartId

String

Required

Unique identifier of the cart.

Example: "cart123"

productId

String

Required

Unique identifier of the product being modified.

Example: "814"

categoryId

String

Optional

Category ID associated with the product.

Example: "222"

productPosition

String

Optional

Position of the product in the cart.

Example: "Cart"

action

String

Optional

Action performed (e.g., editing the cart).

Example: "Edit Cart"

quantity

Integer

Required

The updated quantity of the product in the cart.

Example: 1

productBasePrice

Float

Optional

The updated base price of the product.

Example: 210.00

tax

Float

Optional

Tax applied to the product.

Example: 17.33

sku

String

Optional

Stock keeping unit (SKU) for the product.

Example: "sku123"

discount

Float

Optional

Discount applied to the product.

Example: 5.00

couponCode

String

Required

Coupon code applied to the cart.

Example: "DISCOUNT2024"

Request Body Schema

Copy
{
  "eventData": {
    "cartId": "String",
    "cartProducts": [
      {
        "productId": "String",
        "categoryId": "String",
        "productPosition": "String",
        "action": "String",
        "quantity": "Integer" ,
        "productBasePrice": "Float",
        "tax": "Float",
        "sku": "String",
        "discount": "Float" ,
        "couponCode": "String"
      }
    ]
  }
}

Example Request

Below is the JSON payload for an Edit Cart event. The example modifies the product with ID "814", adjusting its quantity, price, and applying a discount.

Copy
{
  "eventData": {
    "cartId": "cart123",
    "cartProducts": [
      {
        "productId": "814",
        "categoryId": "222",
        "productPosition": "Cart",
        "action": "Edit Cart",
        "quantity": 1,
        "productBasePrice": 210.00,
        "tax": 17.33,
        "sku": "sku123",
        "discount": 5.00,
        "couponCode": "DISCOUNT2024"
      }
    ]
  }
}

Example Response

Copy
{
  "status": "success",
  "message": "Cart item updated successfully."
}

HTTP Response Codes

Response Code

Description

202 Accepted The request has been received and validated, but processing is asynchronous and not yet complete.