Nexus/API Reference/Options and stocks resting orders

Cancel every resting order on a wallet

POSThttps://app.skylit.ai/api/nexus/v1/trading/wallets/{book}/orders/cancel

"cancelAll": true cancels everything resting on the wallet, options stops included. "ticker": "SPY" cancels only that underlying's. It closes nothing: your positions stay open.

A stock stop that's been set off, or an options stop that's firing, can't be cancelled. They're skipped and listed in meta.stopsFilling. meta.nothingToCancel: true means nothing was resting.

Authorization

Authorization: Bearer <your API key>

Required. A missing header returns 401; an invalid, revoked or expired key returns 403.

Path parameters

  • bookstringrequired

    main is your own paper wallet, agent is your bot's.

    mainagent

Request body

  • cancelAllboolean

    true cancels every resting order on the wallet, options stops included.

  • tickerstring

    Cancel only this underlying's orders, like SPY.

  • testboolean

    true cancels the wallet's test orders in your test log only.

Responses

  • 200

    What was cancelled. meta.count is how many.

  • 400

    The request was refused before anything was traded. Codes: bad_request, bad_contract, invalid_quantity, invalid_price, unsupported_asset_class, unsupported_order_type, only_market_orders, limit_price_required (a limit with no limitPrice), invalid_limit_price (not in cents, or outside 0.01 to 99,999.99 for options or 999,999.99 for stocks), stop_price_required (a stop with no stopPrice), invalid_stop_price (not in cents, or outside 0.01 to 999,999.99), invalid_take_profit, test_orders_unavailable, test_modify_unavailable.

  • 401

    No key, or a key that isn't valid. Codes: missing_api_key, invalid_api_key.

  • 429

    Over a rate limit. Wait Retry-After seconds, then retry. Codes: rate_limited, and stream_limit_reached (too many live streams open: 3 per key, 6 per account).

  • 503

    Try again in a moment (honour Retry-After when it's sent). Codes: stale_quote (the quote, or a stock's last trade, is more than 15 seconds old, so nothing filled), no_live_price, rules_pending, unavailable, auth_unavailable, access_check_unavailable, api_keys_unavailable, trades_api_disabled, stream_unavailable (the live stream isn't on, or the server is restarting: try again shortly, or poll the reads).

Response fields

  • dataobject
    • bookstring
      mainagent
    • cancelledobject[]

Last updated

Was this page helpful?