Skip to content

Add Existing Images to Cart ​

API Information ​

  • Request Path: /market/shoppingCart/addProduct
  • Request Method: POST
  • Content-Type: application/json

Request Headers ​

ParameterTypeRequiredDescription
AuthorizationStringYesUser authentication token
Content-TypeStringYesMust be set to application/json

Request Body Structure ​

FieldTypeRequiredDescriptionConstraints
productsList<ProductItemDto>YesList of products to add-

ProductItemDto Structure (Example) ​

FieldTypeRequiredDescriptionConstraints
idLongYesID-
providerStringYesProvider-
productIdStringYesProduct ID-
aoiIdsList<String>NoaoiIds-

Request Body Example ​

json
{
  "products": [
    {
        "id": 45999,
        "productId": "BC2_SP_ORG_2SSV_20221102T184428_003091_000C13",
        "provider": "tianyi",
        "aoiIds": []
    }
  ]
}

Response Body Structure ​

CommonResponse Object ​

FieldTypeDescription
codeIntegerResponse status code
messageStringResponse message
dataIntegerResponse data

Integer Object ​

FieldTypeDescription
valueIntegerNumber 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 CodeDescription
200Success
400Request parameter error
401Unauthorized
500Server internal error

Usage Instructions ​

  1. This API is used to add products to the shopping cart
  2. User authentication is required
  3. Provide a list of product items with IDs and quantities

Notes ​

  • Ensure product IDs are valid