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
idLongNoID-
providerStringNoProvider-
productIdStringYesProduct ID-
unitPriceBigDecimalNoUnit Price-
amountBigDecimalNoAmount-

Request Body Example

json
{
  "products": [
    {
      "amount": 15049.16,
      "id": 86194,
      "productId": "BC3_SM_ORG_2SSV_20230918T071722_001209_0004B9",
      "provider": "tianyi",
      "unitPrice": 21.6
    }
  ]
}

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