Orders
Signed BUY/SELL orders, time in force, maker controls, validation, batch operations, amend, cancel, and kill switch.
Draft v0.1 — design contract, not yet a live service
This documentation set defines a proposed Time Seventeen protocol for review and implementation planning. https://api.t17.capital is the approved and reserved REST origin, but neither that origin nor any documented endpoint is claimed to be live. The WebSocket origin remains unspecified. Credentials, chain IDs, contract addresses, rate limits, and SLAs remain unapproved; IDs, prices, and timestamps shown throughout are illustrative, not real production data.
The Order API carries signed economic intent. Request authentication proves which API credential sent a command; the EIP-712 order signature independently proves what the authorized signer agreed to trade. An acknowledgement is not a fill, and a fill is not settlement.
Endpoint summary
| Method & path | Auth | Purpose |
|---|---|---|
POST /orders | API key + order signature | Place one order |
POST /orders/batch | API key + order signature | Place multiple independently reported orders |
GET /orders | API key | List orders |
GET /orders/{order_id} | API key | Read one order |
POST /orders/{order_id}/cancel | API key | Cancel remaining quantity |
POST /orders/{order_id}/amend | API key + new order signature | Atomic amend/replace |
POST /orders/cancel-all | API key | Account-scoped cancel-all / kill switch |
Every write requires canonical request authentication and Idempotency-Key. Create/amend additionally require the signed typed data described in Authentication.
Economic intent
BUYincreases exposure to the explicitoutcome_idat prices no worse thanlimit_price.SELLreduces exposure, or opens/increases short exposure only when Market and account rules permit, at prices no worse thanlimit_price.- Clients MUST name
market_idandoutcome_id; they MUST NOT infer YES/NO from a quote position. - Draft v0.1 has no unbounded market-order primitive. Immediate execution uses a protected marketable limit order with
FOKorFAKand an explicit worst acceptable price.
Time in force and maker behavior
time_in_force | Behavior | May rest? | Partial fill? |
|---|---|---|---|
GTC | Remains until filled, canceled, paused-policy action, or terminal Market transition | Yes | Yes |
GTD | Same as GTC but no later than signed expires_at | Yes | Yes |
FOK | Immediately fill the entire eligible quantity at permitted prices or execute nothing | No | No |
FAK | Immediately fill available eligible quantity and cancel the remainder | No | Yes |
IOC is accepted in explanatory/client UX language as the industry alias for FAK; the canonical wire value MUST be FAK.
post_only=true is valid only for GTC or GTD. If any part would execute immediately, the complete order is rejected with ORDER_POST_ONLY_WOULD_TAKE; it receives no fill. Maker/taker is ultimately recorded per Fill, not guaranteed merely by a limit price.
Create an order
{
"client_order_id": "client_demo_20260831_001",
"account_id": "acct_demo_001",
"market_id": "mkt_demo_001",
"outcome_id": "out_demo_yes_001",
"side": "BUY",
"order_type": "limit",
"limit_price": "0.6400",
"quantity": "150.00",
"time_in_force": "GTC",
"expires_at": null,
"post_only": true,
"reduce_only": false,
"cancel_on_pause": true,
"self_trade_prevention": "cancel_taker",
"maximum_fee": "1.00",
"maximum_notional": "96.00",
"settlement_asset_id": "asset_demo_collateral_001",
"signature_type": "eoa",
"signature_version": "1",
"order_nonce": "order_nonce_demo_4401",
"order_signature": "0xILLUSTRATIVE_SIGNATURE_ONLY"
}All economic fields MUST be covered by the EIP-712 T17Order message. The signed representation uses integer + scale pairs (for example limit_price_integer=6400, limit_price_scale=4) rather than relying on JSON string parsing. It includes:
- account/funder, signer, Market, Outcome, and side;
- limit price integer/scale and quantity integer/scale;
- time in force, expiry, post-only, reduce-only, and cancel-on-pause;
- self-trade prevention mode;
- hash of
client_order_id; - order nonce and typed-data signature version;
- maximum fee/risk/notional cap and settlement asset;
- environment/audience through domain separation.
The transport body MAY add non-authorizing labels, but any field capable of changing price, size, side, execution, fee, funding, expiry, or risk effect MUST be signed. The server compares signed and transport values byte-for-byte after canonical normalization.
{
"data": {
"order_id": "ord_demo_001",
"client_order_id": "client_demo_20260831_001",
"command_id": "cmd_demo_001",
"status": "open",
"received_at": "2026-08-31T12:00:00.100Z",
"validated_at": "2026-08-31T12:00:00.120Z",
"acknowledged_at": "2026-08-31T12:00:00.130Z",
"original_quantity": "150.00",
"filled_quantity": "0.00",
"remaining_quantity": "150.00",
"average_fill_price": null,
"reserved_amount": "96.00",
"engine_sequence": 992001,
"rejection": null
},
"meta": {
"request_id": "req_demo_order_001",
"published_at": "2026-08-31T12:00:00.130Z",
"schema_version": "1.0"
}
}This response only reports state known at acknowledgement. A fast marketable order may already be filled, partially_filled, or canceled; authoritative executions are still separate Fill records.
Validation order
The server evaluates commands in this deterministic order:
- Parse JSON, media type, and protocol/schema version.
- Authenticate API key, environment, and required scopes.
- Enforce request timestamp, nonce, replay, and idempotency.
- Verify EIP-712 domain, signature type, signer/account authorization, order nonce, expiry, and signed/body equality.
- Resolve Market and Outcome; enforce trading entitlement and Market state.
- Validate side, price/quantity precision, tick/lot/minimum, time-in-force compatibility, and expiry.
- Enforce balance/collateral, reservations, position limits, reduce-only, fee/notional caps, and price protection.
- Enforce self-trade prevention and post-only behavior.
- Acknowledge accepted/rejected state and publish sequenced private events.
The first failing stage determines the primary rejection code. field_violations MAY report independent schema failures from the same stage, but the server MUST NOT leak sensitive downstream account/risk details after an earlier auth failure.
Order state machine
received
├── rejected
└── validated
├── open ── partially_filled ── filled
│ ├── cancel_pending ── canceled
│ ├── expired
│ └── suspended ── open/canceled
├── filled immediate full execution
├── partially_filled ── canceled FAK remainder
└── canceled unfilled FAK/FOKDraft states are received, validated, rejected, open, partially_filled, filled, cancel_pending, canceled, expired, suspended, and failed. failed is reserved for an internal order-processing failure after validation and MUST include an auditable reason; settlement failure does not rewrite an order as failed.
An order response includes timestamps for every reached transition, original/filled/remaining quantity, average fill price, fee accrued, reserved amount, version, engine sequence, and terminal reason. A client MUST use version or engine_sequence to ignore stale projections.
Deterministic immediate-order outcomes
- FOK succeeds: the full quantity produces one or more Fills; final order state is
filled. - FOK cannot fully execute: zero Fills; final state is
canceledwithterminal_reason=FOK_NOT_FILLED. - FAK has liquidity: available quantity fills; remaining quantity is canceled; projection records both quantities.
- FAK has no liquidity: zero Fills; final state is
canceledwithterminal_reason=FAK_NO_FILL. - Post-only crosses: whole order is rejected; zero Fills.
- GTD expires: unmatched remainder becomes
expiredno later than the signed expiry under the engine’s authoritative clock.
Self-trade prevention
Supported modes are:
| Mode | Action on a potential self-match |
|---|---|
cancel_taker | Cancel/reject the incoming aggressing remainder |
cancel_maker | Cancel affected resting order(s), then continue if permitted |
cancel_both | Cancel both affected sides |
The account default is explicit and returned by account policy; clients MUST NOT guess it. Fills sequenced before STP triggers remain valid and are not rolled back.
Reduce-only, pause, and price protection
reduce_only=truepermits only execution that reduces the named Outcome position under the account’s position model. A quantity that would cross through zero is either capped or rejected according to a returned account policy; it MUST NOT silently open the opposite exposure.cancel_on_pause=truerequests cancellation of resting remainder when the Market enterspaused. The transition is asynchronous and remains subject to a race with earlier engine-sequenced Fills.- Every immediately marketable order has an explicit worst
limit_price.maximum_notionalandmaximum_feeare signed additional caps. Server risk controls may be stricter.
Batch placement
POST /orders/batch contains an ordered orders array. Each item carries its own client_order_id, order nonce, and signature; the request has one Idempotency-Key. Results map to the zero-based input index and independently report accepted or rejected.
{
"data": [
{ "index": 0, "status": "accepted", "order_id": "ord_demo_001" },
{
"index": 1,
"status": "rejected",
"error": {
"code": "ORDER_TICK_SIZE_INVALID",
"message": "limit_price is not aligned to price_increment.",
"retryable": false
}
}
],
"meta": {
"request_id": "req_demo_batch_001",
"published_at": "2026-08-31T12:00:00Z",
"schema_version": "1.0"
}
}Draft v0.1 does not promise all-or-none batch atomicity. Request-level authentication/schema failure rejects the request; otherwise each item is independently validated and reported.
List and detail
GET /orders supports market_id, outcome_id, status, side, client_order_id, created_after, created_before, updated_after, cursor, and limit. Default order is (created_at, order_id) descending. GET /orders/{order_id} returns the complete projection and links to Fill IDs and settlement records; it does not embed private signature bytes by default.
Amend/replace
POST /orders/{order_id}/amend is an atomic cancel/replace instruction against expected_order_version. The request specifies the desired new economic intent and carries a fresh order nonce and EIP-712 signature. The server either:
- accepts the replacement, cancels the old remaining quantity, and returns
replaced_by_order_id; or - rejects the amend and leaves the old order unchanged.
Quantity already filled cannot be amended. If a race advances the order version before the command reaches its engine cutoff, the server returns ORDER_VERSION_CONFLICT with the latest safe projection. Draft v0.1 does not define in-place priority preservation; a replacement receives new priority.
Cancel one order
{
"expected_order_version": 3,
"client_cancel_id": "cancel_demo_001",
"reason": "user_request"
}An accepted cancellation enters cancel_pending until the engine cutoff is known, then canceled for remaining quantity. Fills with a lower/equal authoritative cutoff sequence may arrive before or after the HTTP acknowledgement and remain valid. Repeating the same idempotent cancel returns the original result.
Cancel-all / kill switch
POST /orders/cancel-all requires at least one explicit scope filter: account_id plus optional market_id, index_id, venue_id, or cancel_on_pause_only. scope=all_open_orders is an explicit high-impact choice, never a default.
The result reports command_id, number targeted, cancellation states, per-order failures, and an engine cutoff/resume cursor. New order blocking is a separate account-risk control; cancel-all alone MUST NOT be described as disabling future placement.
Representative rejection matrix
| Code | Meaning |
|---|---|
SIGNATURE_ORDER_MISMATCH | Signed economic fields differ from transport body |
REPLAY_ORDER_NONCE_REUSED | Order authorization nonce has already been consumed |
MARKET_NOT_TRADABLE | Market/Outcome state does not accept new orders |
ORDER_TICK_SIZE_INVALID | Price is off the Market increment |
ORDER_LOT_SIZE_INVALID | Quantity is off increment or below minimum |
ORDER_TIF_INCOMPATIBLE | Flags/expiry conflict with time in force |
ORDER_POST_ONLY_WOULD_TAKE | Maker-only order would cross |
ORDER_FOK_NOT_FILLABLE | Full eligible quantity unavailable at allowed prices |
ORDER_DUPLICATE_CLIENT_ID | Active/retained client order ID conflicts |
ORDER_VERSION_CONFLICT | Amend/cancel projection is stale |
RISK_PRICE_PROTECTION | Signed/server protection limit exceeded |
RISK_POSITION_LIMIT_EXCEEDED | Resulting exposure breaches policy |
BALANCE_INSUFFICIENT_COLLATERAL | Available collateral cannot cover reservation |
See Errors for the common envelope and retry rules, and WebSocket for authoritative private order updates.