Appearance
Create Order From Simulation Result
API Information
- Request Path:
/market/order/programming/createFromSimulation - 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 |
|---|---|---|---|---|
| resultId | Long | Yes | Simulation result record id | market_programming_simulation_result.id from simulation results API |
Request Body Example
json
{
"resultId": 123
}Response Body Structure
CommonResponse Object
| Field | Type | Description |
|---|---|---|
| code | Integer | Response status code |
| message | String | Response message |
| data | OrderCreateResp | Response data |
OrderCreateResp Object
| Field | Type | Description |
|---|---|---|
| orderNo | String | Created order number |
Response Examples
Success Response
json
{
"code": 200,
"message": "success",
"data": {
"orderNo": "cff09baa-6bf3-4dc7-98f2-9becd771f1e3"
}
}Failure Response
json
{
"code": 400,
"message": "Simulation result not found or already used",
"data": null
}Error Code Description
| Error Code | Description |
|---|---|
| 200 | Success |
| 400 | Request parameter error or result invalid |
| 401 | Unauthorized |
| 500 | Server internal error |
Usage Instructions
- This API creates a programming order from a single simulation result plan
- User authentication is required
- Obtain
resultIdfrom the simulation results API (/market/order/programming/simulation/results) responsecontent[].id - The simulation task must be in success status before creating order from its result
Notes
- One resultId corresponds to one programming order
- To order multiple plans, call this API multiple times with different resultIds