Skip to content

Query Existing Images from Cart

API Information

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

Request Headers

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

Request Body Structure

None required (User ID is injected from token).

Request Body Example

json
{}

Response Body Structure

CommonResponse Object

FieldTypeDescription
codeIntegerResponse status code
messageStringResponse message
dataShoppingCartRespResponse data

ShoppingCartResp Object

FieldTypeDescription
totalIntegerTotal items
contentList<ImageListRespItem>List of cart items
totalAmountBigDecimalTotal amount
discountAmountBigDecimalDiscount amount
finalAmountBigDecimalFinal amount

ImageListRespItem Object

FieldTypeDescription
idLongItem ID
productIdStringProduct ID
thumbStringThumbnail URL
nameStringProduct Name
resolutionStringResolution
imageTimeStringImage Time
minSizeBigDecimalMinimum Size
deliveryInBigDecimalDelivery Time
unitPriceBigDecimalUnit Price
geometryStringGeometry
areaBigDecimalArea
amountBigDecimalAmount
discountBigDecimalDiscount
discountAmountBigDecimalDiscount Amount
discountUnitPriceBigDecimalDiscount Unit Price
providerStringProvider
satelliteAngleBigDecimalSatellite Angle
centerLongitudeBigDecimalCenter Longitude
centerLatitudeBigDecimalCenter Latitude

Response Examples

Success Response

json
{
  "code": 200,
  "message": "success",
  "data": {
    "total": 1,
    "content": [
      {
        "id": 12345,
        "productId": "product_123",
        "thumb": "http://example.com/thumb.jpg",
        "name": "SAR Image",
        "resolution": "0.5m",
        "imageTime": "2023-10-27 10:00:00",
        "minSize": 25.0,
        "deliveryIn": 24.0,
        "unitPrice": 100.0,
        "geometry": "{\"type\":\"Polygon\",\"coordinates\":[[[102.61282157031928,21.488503948497097],[106.99114976403081,21.488503948497097],[106.99114976403081,18.594746845159506],[102.61282157031928,18.594746845159506],[102.61282157031928,21.488503948497097]]]}",
        "area": 50.0,
        "amount": 5000.0,
        "discount": 0.9,
        "discountAmount": 500.0,
        "discountUnitPrice": 90.0,
        "provider": "tianyi",
        "satelliteAngle": 15.0,
        "centerLongitude": 120.0,
        "centerLatitude": 30.0
      }
    ],
    "totalAmount": 5000.0,
    "discountAmount": 500.0,
    "finalAmount": 4500.0
  }
}

Failure Response

json
{
  "code": 400,
  "message": "Error querying cart",
  "data": null
}

Error Code Description

Error CodeDescription
200Success
400Request parameter error
401Unauthorized
500Server internal error

Usage Instructions

  1. This API is used to query the current user's shopping cart
  2. User authentication is required
  3. Returns cart items and total price

Notes

  • User ID is obtained from the authorization token