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 |
| outputFolderId | Long | No | Output folder ID | - |
| ossOutputId | Long | No | Existing object storage output config ID | If provided together with ossOutput, this field takes precedence |
| ossOutput | Object | No | New object storage output config | - |
| recurring | Boolean | No | Create recurring parent order with first child order | default false |
| recurringDay | Integer | No | Recurring interval value | Required when recurring=true, must be > 0 |
| recurringUnit | Integer | No | Recurring interval unit | Required when recurring=true; 1=Day, 2=Week, 3=Month |
OssOutputPayload Structure (ossOutput)
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| name | String | No | Config name | - |
| endPoint | String | No | Endpoint | - |
| ak | String | No | Access key | - |
| sk | String | No | Secret key | - |
| accessPath | String | No | Base access path | - |
Request Body Example
json
{
"resultId": 123,
"recurring": false
}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 - If
recurring=true,recurringDayandrecurringUnitare required - 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