Development Guides

Quick Trade

The Quick Trade tool in Eclipse is used to create single buy or sell trades in an account. It can also be used to import a list of buy and sell trades for multiple accounts.

The tool in the Eclipse API consists of 3 main parts:

  • Issuing a request for a single Account, or uploading an import file to trade multiple Accounts.
  • Validation
    • This step is optional, but can give you some insight about what may or may not be wrong with your proposed trades.
    • Trade validation is only applicable to single Account Buy and Sell Quick Trades.
  • Creating Orders

Validation (optional)

The validation step is optional, and only applies to Buy and Sell Quick Trades. The validation endpoint supports many trade tools, but for Quick Trades, the request is fairly simple.

NameTypeRequiredDescription
actionnumberyes1=Buy, 2=Sell
tradeSharesnumberno*number of shares to trade, fractional shares are allowed depending on custodian configuration
tradePercentnumberno*percent of security holdings held, applies to sell trades only
tradeAmountnumberno*dollar amount to trade
accountIdnumberyesid of the account being traded
portfolioIdnumbernoid of the portfolio being traded
securityIdnumberyesid of the security being traded
symbolstringnoticker of the security being traded
*one of tradeShares, tradePercent or tradeAmount must be provided

Quick Trade, Validation

POST api/v2/tradeorder/trades/action/validate

{
    "application": "QuickTrades",
    "trades": [
        {
            "action": 1,
            "tradeShares": null,
            "tradePercent": null,
            "tradeAmount": 2100.57,
            "accountId": 127,
            "portfolioId": 227,
            "securityId": 13,
            "symbol": "AAPL"
        }
    ]
}

Creating Orders

Order creation is done through V1 and V2 endpoints, depending on what type of Quick Trade you are requesting:

  • V1: Account Liquidation
  • V2: Account Buy and Sell Quick Trades

Quick Trade, Account Liquidation

NameTypeRequiredDescription
accountIdnumberyesid of the account being traded
portfolioIdnumbernoid of the portfolio being traded
actionIdnumberyes6=Liquidate
tradeToolSelectionnumberno**2=Acccount
tradeInstanceTypenumberno**5=Quick Trade
tradeInstanceSubTypenumberno**11=Quick Trade
isSendImmediatelybooleannotrue=Execute Trades Immediately
**tradeToolSelection, tradeInstanceType and tradeInstanceSubType shows how an account was chosen to trade, and which tool did the trading. They are optional, but without them, the Trade Instance metadata will be missing that information.

POST api/v1/tradeorder/trades

{
    "accountId": 127,
    "portfolioId": 227,
    "actionId": 6,
    "tradeToolSelection": 2,
    "tradeInstanceType": 5,
    "tradeInstanceSubType": 11,
    "isSendImmediately": false
}

Quick Trade, Create Order

NameTypeRequiredDescription
applicationstringyesname of the Trade Tool, always “QuickTrades” in this use case
actionnumberyes1=Buy, 2=Sell
isSendImmediatelybooleannotrue=Execute Trades Immediately
portfolioIdnumberyesid of the portfolio being traded
accountIdnumberyesid of the account being traded
tradeSharesnumberno*
tradePercentnumberno*
tradeAmountnumberno*
securityIdnumberyes
tradeToolSelectionnumberno**2=Acccount
tradeInstanceTypenumberno**5=Quick Trade
tradeInstanceSubTypenumberno**11=Quick Trade
*one of tradeShares, tradePercent or tradeAmount must be provided

**tradeToolSelection, tradeInstanceType and tradeInstanceSubType shows how an account was chosen to trade, and which tool did the trading. They are optional, but without them, the Trade Instance metadata will be missing that information.

POST api/v2/tradeorder/trades

{
    "application": "QuickTrades",
    "trades": [
        {
            "action": 1,
            "isSendImmediately": false,
            "portfolioId": 227,
            "accountId": 127,
            "tradeShares": null,
            "tradePercent": null,
            "tradeAmount": 2100.57,
            "securityId": 13
        }
    ],
    "tradeToolSelection": 2,
    "tradeInstanceType": 5,
    "tradeInstanceSubType": 11
}