Remove shopping cart item interface

Remove the specified product from the shopping cart, delete the corresponding shopping cart record according to the shopping cart ID.

Points to note

  • The API uses the POST method and requires data to be submitted in application/ format
  • Provide the ID of the shopping cart record instead of the product ID
  • Supports logged-in users and anonymous users (identified through cart token)
  • Message returned after successful deletion

Request address

{域名地址}/api/cart/remove

Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/cart/remove

Request Syntax

POST {域名地址}/api/cart/remove
Content-Type: application/json

Request Headers

Field name Type Required Description
cart string No Use this token as user identification when not logged in

This interface also involves common request headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Request parameters

| Field Name | Type | Required| Description |

id int Is

Response header

This interface only involves common response headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Return parameters

Field name Type Description
code int Error code
msg string Error description

Usage Example

Request example

POST /api/cart/remove HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json

{
  "id": 101
}

Response Example

{
  "code": 0,
  "msg": "删除成功"
}

error code

Error code Description
0 OK
-1 Error, the reason is indicated in msg
1001 Not logged in
1002 Not authorized
200 API request OK