Documentation

Create a multileg order

Place a complex order (multi-leg) to be executed. This order will be sent to the market and executed according to your specifications.

This consists of two order kinds: multileg and combo orders. We accept a maximum of 4 option legs for multileg orders and 2 legs (1 equity, 1 option) for combo orders. Before placing the order for execution, it is advisable to place a preview order.

Endpoint

Method
POST
URL
/v1/accounts/{account_id}/orders

Headers

Accept
application/xml, application/json, application/javascript
Default: application/xml
Required: false
Authorization
Bearer {access token}
Required: true

Path Parameters

account_id
An account number

Form Parameters

class
The kind of order to be placed
Options: multileg, combo
Required: true
symbol
The underlying symbol ordered for all legs.
Required: true
duration
Options: day, gtc
The time for which the order will be remain in effect
Required: true
type
The type of order to be placed.
Options: market, debit, credit, even
Required: true
price
The desired order price for "debit" and "credit" orders.
Required for "debit", "credit" orders.
side[index]
The side of the leg at "index".
Equity leg options: buy, buy_to_cover, sell, sell_short
Option leg options: buy_to_open, buy_to_close, sell_to_open, sell_to_close
Required: true
quantity[index]
The number of shares/contracts of the leg at "index".
Required: true
option_symbol[index]
An OCC formatted option symbol (AAPL140118C00195000) of the leg at "index"
This should still be sent as null for equity legs.
Required: true

Response

Field Description
id Order ID
status Acknowledgement of receipt

Example

Command

$ curl -X POST -H "Authorization: Bearer {access token}" https://api.tradier.com/v1/accounts/12345678/orders

Request

POST /v1/accounts/12345678/orders HTTP/1.1
User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
Host: api.tradier.com
Accept: */*

class=multileg&symbol=CSCO&duration=day&type=market
  &side[0]=buy_to_open&quantity[0]=1&option_symbol[0]=CSCO150117C00035000
  &side[1]=sell_to_open&quantity[1]=1&option_symbol[1]=CSCO140118C00008000

Response

HTTP/1.1 200 OK
Content-Type: application/xml;charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<order>
    <id>2098</id>
    <status>ok</status>
</order>

Tradier Inc. and its corresponding technology services (including API services) are distinct and separate from the services provided by Tradier Brokerage Inc. For more information regarding the services of Tradier, Inc., please contact techsupport@tradier.com. For more information regarding the services of Tradier Brokerage, Inc. please contact service@tradierbrokerage.com. Tradier Brokerage Inc. Member FINRA/SIPC

© 2017 Tradier Inc.
  • 11016 Rushmore Drive, Suite 350
  • Charlotte, NC 28277

All materials contained on this site and specifically the API documentation pages are protected by United States copyright law and may not be copied, reproduced, distributed, transmitted, displayed, published or broadcast without the prior written permission of Tradier Inc. The Structure, Format, Layout, Examples and Design of the pages are owned by Tradier Inc, and any efforts to willfully or accidently duplicate a whole or part of the pages on this site is a violation of United States copyright law.