Skip to content

Remove Cart Item

Description

The Remove Cart Item API allows users to remove a specific item from their cart.

  • Authenticated Users: Must provide a valid JWT token.
  • Guest Users: Must provide a sessionId to track the cart.
  • The X-MerchantApiKey header is mandatory for all requests.

Endpoint

PATCH /v1/carts/remove/{carItemId}

Required Headers

json
{
  "Authorization": "Bearer JWT_TOKEN", // For authenticated users
  "X-MerchantApiKey": "MERCHANT_API_KEY",
  "Content-Type": "application/json"
}

Example API Call (Fetch or Axios)

javascript
fetch('https://api.shopsynch.com/v1/carts/remove/679f8f5a3b5f2173201c2582', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer JWT_TOKEN',
    'X-MerchantApiKey': 'MERCHANT_API_KEY',
    'Content-Type': 'application/json'
  }
})
.then(response => response.json())
.then(data => console.log(data));

📤 Sample 200 Response (Success)

json
{
    "message": "Item Removed from Cart",
    "status": true
}

Next Steps

Build with joy