API ReferencePaper Trading
Cancel a working simulated order and release its unspent hold.
const url = 'https://data.predictefy.com/v1/paper/orders/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cancel';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://data.predictefy.com/v1/paper/orders/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cancel \ --header 'Authorization: Bearer <token>'Only open and partially_filled orders can be canceled; anything terminal returns 409 PAPER_ORDER_NOT_OPEN. The released amount is recomputed from the order's own fills, so a partially filled cancel never hands back cash already spent on fills.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Owned paper order id.
Responses
Section titled “Responses”The canceled order.
object
object
Present only on the single-order read; omitted from list pages.
object
The book snapshot this fill was matched against, when one is known.
Which schedule priced the fill. unverified is a LABELLED zero fee.
Why the order changed to its current status, including account resets.
Example
{ "data": { "fills": [ { "feeModel": "verified", "liquidity": "maker", "rule": "marketable_walk" } ], "side": "buy", "status": "open", "tif": "GTC" }}UNAUTHORIZED
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}INSUFFICIENT_CREDITS: paper weight
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}SCOPE_MISSING: API key lacks the trade scope; PLAN_REQUIRED: the account's plan does not include paper trading
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}PAPER_ORDER_NOT_FOUND for an unknown order; ROUTE_NOT_FOUND when this feature is not available.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}PAPER_ORDER_NOT_OPEN: the order already reached a terminal status
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}RATE_LIMITED
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Unexpected service error. Retryable; error.requestId identifies the failure.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}PLATFORM_UNAVAILABLE
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}A statement timeout exceeded the read time budget (QUERY_TIMEOUT). Not retryable: the same query times out again at once, so narrow the window or try again later.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}