Skip to content

Create Existing Images Order

API Information

  • Request Path: /market/order/create
  • 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-
totalAmountBigDecimalYesTotal order amount-
thumbStringNoThumbnail URL-

ProductItemDto Structure

FieldTypeRequiredDescriptionConstraints
idLongNoID-
providerStringNoProvider-
productIdStringYesProduct ID-
unitPriceBigDecimalNoUnit Price-
amountBigDecimalNoAmount-
discountBigDecimalNoDiscount-
discountAmountBigDecimalNoDiscount Amount-
discountUnitPriceBigDecimalNoDiscount Unit Price-

Request Body Example

json
{
  "products": [
    {
      "id": 1,
      "provider": "changguang",
      "productId": "product_123",
      "unitPrice": 100.0,
      "amount": 100.0,
      "discount": 0.0,
      "discountAmount": 0.0,
      "discountUnitPrice": 100.0
    }
  ],
  "totalAmount": 100.00,
  "thumb": "http://example.com/thumb.jpg"
}

Response Body Structure

CommonResponse Object

FieldTypeDescription
codeIntegerResponse status code
messageStringResponse message
dataOrderCreateRespResponse data

OrderCreateResp Object

FieldTypeDescription
orderNoStringCreated order number

Response Examples

Success Response

json
{
  "code": 200,
  "message": "success",
  "data": {
    "orderNo": "ORDER_202310270001"
  }
}

Failure Response

json
{
  "code": 400,
  "message": "Invalid total amount",
  "data": null
}

Error Code Description

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

Usage Instructions

  1. This API is used to create a new order
  2. User authentication is required
  3. Provide list of products and total amount

Notes

  • Total amount should match the sum of product prices