API Reference
POST
/v1/orders Place order
提交市价单或限价单,支持幂等键。
Parameters
This endpoint has no path or query parameters.
Request body
| Name | Location | Type | Required | Constraints |
|---|---|---|---|---|
tokenId | body | string | yes | minLength: 1 |
action | body | BUY | SELL | yes | enum: BUY, SELL |
orderType | body | market | limit | yes | enum: market, limit |
amount | body | number | no | min: 0 exclusive |
shares | body | number | no | min: 0 exclusive |
price | body | number | no | min: 0 exclusive · max: 1 exclusive |
tickSize | body | string | no | minLength: 1 |
idempotencyKey | body | string | no | minLength: 1 · maxLength: 128 |
Responses
200 OK
400 Bad Request
401 Unauthorized
404 Not Found
502 Upstream Error
Examples
curl -X POST 'https://api.jd.io/v1/orders' \
-H 'Authorization: Bearer <USER_API_KEY>' \
-H 'Content-Type: application/json' \
--data '{
"tokenId": "<TOKEN_ID>",
"action": "BUY",
"orderType": "market",
"amount": 10,
"shares": 10,
"price": 0.42,
"tickSize": "<TICKSIZE>",
"idempotencyKey": "order-20260530-001"
}' {
"tokenId": "<TOKEN_ID>",
"action": "BUY",
"orderType": "market",
"amount": 10,
"shares": 10,
"price": 0.42,
"tickSize": "<TICKSIZE>",
"idempotencyKey": "order-20260530-001"
} {
"ok": true,
"data": {
"idempotencyKey": "order-20260530-001",
"message": "Order submitted"
}
}