OrdersService
Create Order
Create a single order with side, type, quantity, and optional price fields. Supports optional client order IDs and attached risk instructions (take-profit, stop-loss, trailing stop). Each submission is independent and has no exact-replay guarantee. Reusing a retained client order ID conflicts, even with identical payload. Do not automatically retry an ambiguous timeout: reconcile through GetOrder by client order ID if supplied; otherwise accept ambiguity. An immediate lookup miss does not prove rejection.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/v1/orders' \
--header 'Accept: */*' \
--header 'X-API-KEY-ID: YOUR_API_KEY_ID' \
--header 'X-API-TIMESTAMP: YOUR_API_TIMESTAMP' \
--header 'X-API-SIGNATURE: YOUR_API_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{
"order": {
"attachedRisk": {
"oco": false,
"stopLoss": {
"child": {
"marketIoc": {}
},
"triggerPrice": "0.005"
},
"takeProfit": {
"child": {
"marketIoc": {}
},
"triggerPrice": "0.005"
}
},
"baseQty": "100000",
"clientOrderId": "cli-ord-20250101-001",
"feeAsset": "QUOTE",
"marketIoc": {
"clientRefPrice": "0.005",
"maxSlippageTicks": 1
},
"selfTradePreventionMode": "EXPIRE_MAKER",
"side": "BUY",
"symbol": "BTC-USDT"
},
"subaccountId": "45LUmqjT"
}'Responses
{
"acceptedAt": "2025-01-01T00:00:00Z",
"acceptedAtTsNs": "1735689600000000000",
"clientOrderId": "cli-ord-20250101-001",
"orderId": "5USXJZmk",
"resolvedBaseQty": "100000",
"stopLossTriggerId": "4xSAAbhk",
"submittedMaxQuoteDebit": "1",
"takeProfitTriggerId": "24nxLcBt",
"trailingStopTriggerId": "59VD7Lat"
}If true, take-profit and the configured stop leg (stop-loss or trailing-stop) form an OCO pair: when one fires, the other is canceled. Default is false (no mutual cancellation).
Limit price in quote units scaled by 1e9.
Market child with implicit IOC behavior.
Trigger price in quote units scaled by 1e9.
Limit price in quote units scaled by 1e9.
Market child with implicit IOC behavior.
Trigger price in quote units scaled by 1e9.
Optional activation price: trailing only starts after this price is reached. If omitted, trailing starts immediately after the parent order fills. Expressed in quote units scaled by 1e9.
Maximum allowed slippage in basis points (1 bp = 0.01%).
Positive maximum absolute price delta in Q9 execution-price ticks (1 tick = 1e-9 quote units).
Trailing distance in basis points (1 bp = 0.01%).
Trailing distance as a price delta in 1e-9 quote-unit ticks.
Exact gross base quantity as a human-readable decimal using the pair's base quantity scale.
Optional account-scoped identifier for correlation, lookup, and cancellation. While this identifier is retained, reuse returns CONFLICT_DUPLICATE_CLIENT_ORDER_ID for every new submission, even with the same payload. This identifier enables GetOrder reconciliation after a timeout; it does not provide exact replay.
Asset charged for fees. Defaults to QUOTE. BASE is available only for BUY orders; SELL orders must use QUOTE.
Limit price in quote units scaled by 1e9.
Reject the order instead of taking liquidity. Post-only is available only on this resting limit-order variant.
Limit price in quote units scaled by 1e9.
Exact expiry time in UTC. It must be at least 1 second and at most 30 days after validation time. The order cannot execute when the current time equals this value.
Reject the order instead of taking liquidity.
Limit price in quote units scaled by 1e9.
Limit price in quote units scaled by 1e9.
Optional client reference price in quote units scaled by 1e9. When omitted, admission uses server-side reference pricing.
Maximum allowed slippage in basis points (1 bp = 0.01%).
Positive maximum absolute price delta in Q9 execution-price ticks (1 tick = 1e-9 quote units).
Hard all-in quote debit limit scaled by the pair's quote_quantity_scale from GetSpotConfig. Valid only for BUY market IOC and BUY limit IOC.
Self-trade prevention mode. Defaults to EXPIRE_MAKER if unspecified.
Order side.
Trading pair symbol, e.g. BTC-USDT.
Target sub-account numeric ID. When omitted, uses caller's root account.
Time admission completed.
2025-01-01T00:00:00ZAdmission completion time as epoch nanoseconds (UTC).
1735689600000000000Echoed client order ID when one was supplied.
cli-ord-20250101-001Assigned order ID.
5USXJZmkGross base quantity resolved for execution, scaled by the pair's base_quantity_scale from GetSpotConfig.
100000Trigger ID for attached stop-loss.
4xSAAbhkSubmitted hard all-in quote debit limit, scaled by the pair's quote_quantity_scale from GetSpotConfig. Present only when that sizing method was submitted.
1Trigger ID for attached take-profit.
24nxLcBtTrigger ID for attached trailing stop.
59VD7Lat| Key | Status | Error | When |
|---|---|---|---|
| unauthenticated | 401 | Unauthenticated | Authentication required. |
| permission-denied | 403 | Permission Denied | Permission denied. |
| invalid-argument | 400 | Invalid Argument | Invalid argument. |
| not-found | 404 | Not Found | Not found. |
| unavailable | 503 | Unavailable | Service unavailable. |