Remove Products from customer's cart
Endpoint:
https://merchant.payervault.com/api/v1/cart
Method:
Description:
This API endpoint allows users to remove products from their cart. Users can specify the products they want to delete from the cart based on their IDs.
Authentication
This endpoint requires authentication using an accessKey and accessSecret. These credentials need to be included in the request headers for authorization.
Request Header:
accessKey : | Access key for authentication |
---|---|
accessSecret : | Access secret for authentication. |
Request Body:
-
Schema:
{ "customerID": "string (required)", "products": ["string (required)"] }
Response:
- Success Response:
- Status Code: 206 (Partial Content)
- Content Type: JSON
- Response Body: An object indicating the success of the operation.
- Error Response:
- Status Code: 206 (Partial Content) or 500 (Internal Server Error)
- Content Type: JSON
- Response Body: An error message explaining the issue encountered.
Sample Usage:
// Sample Request Headers
accessKey: your-access-key
accessSecret: your-access-secret
// Sample Request Body
{
"customerID": "customer-id-123",
"products": ["product-id-1", "product-id-2"]
}
// Sample Response (Success)
{
"success": true,
"message": "Product deleted successfully"
}
// Sample Response (Error)
{
"message": "Internal Server Error"
}
Notes:
- This endpoint requires authentication with an access key and access secret provided in the request headers.
- The request body should contain the ID of the customer and an array of product IDs to be deleted from the cart.
- The existing cart items are fetched based on the user's ID, live status, and customer ID.
- If the specified products exist in the cart, they will be removed from the cart.
- Error handling is implemented to catch and respond appropriately to any internal server errors.