Appearance
Add Existing Images to Cart
API Information
- Request Path:
/market/shoppingCart/addProduct - Request Method:
POST - Content-Type:
application/json
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | String | Yes | User authentication token |
| Content-Type | String | Yes | Must be set to application/json |
Request Body Structure
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| products | List<ProductItemDto> | Yes | List of products to add | - |
ProductItemDto Structure (Example)
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| id | Long | Yes | ID | - |
| provider | String | Yes | Provider | - |
| productId | String | Yes | Product ID | - |
| aoiIds | List<String> | No | aoiIds | - |
Request Body Example
json
{
"products": [
{
"id": 45999,
"productId": "BC2_SP_ORG_2SSV_20221102T184428_003091_000C13",
"provider": "tianyi",
"aoiIds": []
}
]
}Response Body Structure
CommonResponse Object
| Field | Type | Description |
|---|---|---|
| code | Integer | Response status code |
| message | String | Response message |
| data | Integer | Response data |
Integer Object
| Field | Type | Description |
|---|---|---|
| value | Integer | Number of items added |
Response Examples
Success Response
json
{
"code": 200,
"message": "success",
"data": 1
}Failure Response
json
{
"code": 400,
"message": "Invalid product ID",
"data": null
}Error Code Description
| Error Code | Description |
|---|---|
| 200 | Success |
| 400 | Request parameter error |
| 401 | Unauthorized |
| 500 | Server internal error |
Usage Instructions
- This API is used to add products to the shopping cart
- User authentication is required
- Provide a list of product items with IDs and quantities
Notes
- Ensure product IDs are valid