Change a resting spread order
https://app.skylit.ai/api/nexus/v1/spreads/orders/{orderId}/modifyChange a resting spread order's quantity, limitPrice or both. It keeps its orderId. Everything else stays: to change the legs or the type, cancel it and place a new one. Changing an open needs the same checks as opening one; a close can always change. While Simulated is paused for members, no order can change (403 paper_desk_paused). Send the same change with the confirmationToken from POST .../modify/preview. A change that isn't what was previewed answers 409 preview_mismatch. One that crosses the natural fills now.
curl -s -X POST "https://app.skylit.ai/api/nexus/v1/spreads/orders/7f7ef4d3-0ed3-4bef-9daa-a6ae9cd05bd3/modify" \
-H "Authorization: Bearer $SKYLIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"confirmationToken":"099c123d6e20ed3f4ab17abe0ff4872900503bea2fa0fbb129e79681dc053f83","limitPrice":1.6}'
Authorization
Authorization: Bearer <your API key>Required. A missing header returns 401; an invalid, revoked or expired key returns 403.
Path parameters
orderIdstringuuidrequiredThe spread order's
orderId, from the place or the order list.
Request body
accountstringmainor left out. Any other account answers422 port_unsupported.mainportstringLeave it out. Spreads trade on your main account only, so any port answers
422 port_unsupported.quantityintegerThe new number of spreads.
limitPricenumberThe new net price per spread, positive.
confirmationTokenstringModify only: the token from
POST .../modify/previewfor this exact change. The preview ignores it.
Responses
- 200
The order, changed.
- 400
Refused before anything was sent. Codes:
bad_request(an unknown field, a leg that isn'toptionsorstocks, legs that don't form thestrategy, a missinglimitPriceon a limit, a market order with one, a quantity over 100, a modify with neitherquantitynorlimitPrice, adatethat isn'tYYYY-MM-DD),expiry_day_cutoff(on a leg's expiration day, new spread opens stop at 3:00 PM ET; closes are never refused). - 401
No key, or a key that isn't valid. Codes:
missing_api_key,invalid_api_key. - 403
The key works but this can't happen right now. Codes:
feature_disabled(spreads aren't open to you, opening spreads is switched off while you can still close and cancel, or a broken wing butterfly),main_not_enabled(an open while "Let my agent trade my main account" is off; closes, cancels and exits never need it),paper_desk_paused(Simulated is paused for members: you can still preview and place a close, cancel, and take an exit off),read_only, plus the sharedaccount_suspendedandnexus_access_denied. - 404
Not on your account. Codes:
order_not_found(no spread order of yours with that id),spread_not_found(no open spread of yours with that id). - 409
It clashes with what you hold or sent before. Codes:
preview_mismatch(the ticket isn't what the preview priced: preview again),spread_conflict(closing a spread you don't hold, closing more than you hold or than your resting closes leave, or opening one you hold the other way round: close it instead),working_order_limit(your resting API orders, stops included, and every working spread order count together toward 50, spread orders placed on the Spreads ticket in Nexus included),client_order_id_used,order_not_working(it already filled, expired, or was cancelled or rejected),exit_triggered(the stop or target was reached and the spread is closing, so its exit can't change). - 422
Read fine, but the account says no. Codes:
port_unsupported(any account butmain, or any port),insufficient_buying_power(withorderIdwhen the order was recorded as rejected),order_rejected(recorded as rejected as it was placed;orderIdpoints to it),contract_expired. - 429
Over a rate limit. Wait
Retry-Afterseconds, then retry. Codes:rate_limited, andstream_limit_reached(too many live streams open: 3 per key, 6 per account). - 500
Something went wrong on our side. If you sent a
clientOrderId, retry with the same one. Code:internal_error. - 503
Try again in a moment. Codes:
no_live_quote(a leg, or the underlying, has no live quote; quotes older than 15 s never fill),unavailable(spreads aren't on this server, or a check couldn't be read).
Response fields
dataobjectrequiredOne spread order, as every spread order route and the live stream return it. A figure that hasn't happened yet is
null, never0.orderIdstringuuidclientOrderIdstringaccountstringmainstrategystringunderlyingstringpositionEffectstringOPENCLOSEnetEffectstringDEBITCREDITorderTypestringLIMITMARKETtimeInForcestringDAYGTCquantityintegerfilledQuantityintegerlimitPricenumber | nullPer spread.
nullon a market order.averageFillPricenumber | nullThe net per spread it filled at.
nulluntil it fills.realizedPnlnumber | nullDollars a filled close made or lost.
nullon an open, and until a close fills.feesnumber | nullDollars the fill paid.
nullbefore it fills.statusstringUpper case, as on the Spreads ticket in Nexus.
WORKINGFILLEDCANCELLEDREJECTEDEXPIREDcancellablebooleantruewhile it rests.receivedAtstring | nulldate-timemessagestring | nullWhy it was rejected or ended, when there's a reason.
legsobject[]
metaobjectrequiredaccountstringmain
Last updated