Stocks Developer — Broker-Independent Trading API reference (HTTP only) This file is the complete, current reference for building a HTTP program that places, modifies, cancels and reads orders across many Indian broker accounts through AutoTrader Web — every API call, its parameters, its response, and the HTTP code samples. It is generated from the official documentation at https://stocksdeveloper.in every time that documentation changes, so it is never out of date. Documentation last updated: 2026-09-07 How to use it: give this whole file to your AI coding assistant (ChatGPT, Claude, Gemini, Copilot or any other) BEFORE you ask it to write anything. Guide for humans: https://stocksdeveloper.in/documentation/build-with-ai/ ============================================================================== INSTRUCTIONS FOR THE AI ASSISTANT READING THIS FILE ============================================================================== You are helping someone who uses AutoTrader Web by Stocks Developer. Follow these rules for every line of code you write for them: 1. Use ONLY the field names, parameter names, function names and allowed values defined in this file. If something you need is not here, say so plainly — do not invent it, and do not borrow a name from another trading API. 2. Values are exact words. Write INTRADAY, DELIVERY, NORMAL, MTF, BUY, SELL, MARKET, LIMIT, STOP_LOSS, SL_MARKET exactly as spelled here, not a broker's short form. 3. The same code must work on every broker. Never write broker-specific symbols, broker-specific logic, or a call to a broker's own API. 4. Always handle the failure case. Every call can fail; read the status and the message and report it, never assume success. 5. When you finish, check your own code line by line against this file, and list every field or function you were not fully sure about instead of quietly guessing it. 6. Never place a real order to test. Tell the user to test with the smallest quantity, in one account, before anything else. 7. This is a tools-only platform. Do not offer trading advice, tips or a strategy — the strategy belongs to the user. 8. Authenticate with the api-key HTTP header, or with the library's own setup shown in the client guide. Never hard-code an API key into code you show the user — read it from a config file or an environment variable, and say why. 9. Every call takes a pseudo account name. That is how one program trades many accounts and many brokers, so make it a parameter, never a constant buried in the code. 10. Use our broker-independent symbols exactly as documented. Do not build a symbol by string-joining parts unless the documentation shows that format. 11. Before writing a whole program, tell the user they can try any single call by hand with the Postman collection. 12. Write HTTP only. Code samples for the other client languages have been removed from this file on purpose — if the user asks for another language, tell them to fetch that language's pack instead of guessing. ============================================================================== CONTENTS ============================================================================== 1. API (Application Programming Interface) — https://stocksdeveloper.in/documentation/api/ 2. API Parameters — https://stocksdeveloper.in/documentation/api/api-parameters/ 3. API Rate Limits — https://stocksdeveloper.in/documentation/api/api-rate-limits/ 4. Cancel All Orders — https://stocksdeveloper.in/documentation/api/cancel-all-orders/ 5. Cancel Child Orders — https://stocksdeveloper.in/documentation/api/cancel-child-orders/ 6. Cancel Order — https://stocksdeveloper.in/documentation/api/cancel-order/ 7. Create or Update Trading Account — https://stocksdeveloper.in/documentation/api/create-or-update-trading-account/ 8. Email Limits — https://stocksdeveloper.in/documentation/api/email-limits/ 9. Fetch All Trading Accounts — https://stocksdeveloper.in/documentation/api/fetch-all-trading-accounts/ 10. Fetch Live Pseudo Accounts — https://stocksdeveloper.in/documentation/api/fetch-live-pseudo-accounts/ 11. Modify Order — https://stocksdeveloper.in/documentation/api/modify-order/ 12. Modify Order Price — https://stocksdeveloper.in/documentation/api/modify-order-price/ 13. Modify Order Quantity — https://stocksdeveloper.in/documentation/api/modify-order-quantity/ 14. Place Advanced Order — https://stocksdeveloper.in/documentation/api/place-advanced-order/ 15. Place AutoTrader Bracket Order — https://stocksdeveloper.in/documentation/api/place-autotrader-bracket-order/ 16. Place AutoTrader Cover Order — https://stocksdeveloper.in/documentation/api/place-autotrader-cover-order/ 17. Place Bracket Order — https://stocksdeveloper.in/documentation/api/place-bracket-order/ 18. Place Cover Order — https://stocksdeveloper.in/documentation/api/place-cover-order/ 19. Place Regular Order — https://stocksdeveloper.in/documentation/api/place-regular-order/ 20. Read Holdings — https://stocksdeveloper.in/documentation/api/read-holdings/ 21. Read Margins — https://stocksdeveloper.in/documentation/api/read-margins/ 22. Read Orders — https://stocksdeveloper.in/documentation/api/read-orders/ 23. Read Positions — https://stocksdeveloper.in/documentation/api/read-positions/ 24. Square-off Portfolio — https://stocksdeveloper.in/documentation/api/square-off-portfolio/ 25. Square-off Position — https://stocksdeveloper.in/documentation/api/square-off-position/ 26. Validate Trading Account Credentials — https://stocksdeveloper.in/documentation/api/validate-trading-account-credentials/ 27. HTTP REST — https://stocksdeveloper.in/documentation/client-setup/http-rest-api/ ============================================================================== PAGE 1 OF 27 — API (Application Programming Interface) URL: https://stocksdeveloper.in/documentation/api/ Last updated: 2026-09-07 Summary: Our trading API lets you place, modify, cancel and read orders across many Indian stock brokers using the same code. Each function takes an account number, so one set of code and one login can trade across multiple accounts. Standard symbols and broker independent design mean you do not write broker specific code. Libraries are available for Java, Python, C#, Excel, AmiBroker, MetaTrader and HTTP REST. ============================================================================== An API (Application Programming Interface) is a contract, or set of rules, that lets two software systems talk to each other. Programmers use APIs to build custom trading systems, such as algorithmic trading systems or systems made for a specific client's needs. See the full list of [supported brokers](https://stocksdeveloper.in/documentation/supported-brokers/). ## Demo video ## AutoTrader Web APIs Our APIs are designed to work the same way no matter which broker you use. - **Broker independent (multi-broker)** - The same code works across many different stock brokers. - Your system stays compatible with many brokers at once. - **Multi-account** - Trade across multiple accounts easily. Every API function accepts an account number as a parameter. - One API authentication covers all of your trading accounts. - **Broker independent symbols** - We provide standard symbols that work across all brokers. - You do not need to handle broker-specific symbols in your code. - **Low latency** - On average 100 to 200 milliseconds. - **Industry leading documentation** ## How to measure your order speed Order placement takes 100 to 200 milliseconds on average. About 20 milliseconds of that is our system; the rest is your broker. You can check these numbers on your own account. The API response does not carry timing, but you do not need to add any timing code, because every order is already recorded in your activity log with a timestamp accurate to the **millisecond**. 1. Place the order as usual. The response contains a `commandId`. 2. Open **Tools -> Activity** in AutoTrader Web and paste that command id into the filter box. 3. You will see two entries for that order. `Placing order: Order [...]` is the moment we received it, and `SUCCESS - [...]. Result: ...` is the moment your broker replied with the order id. 4. Subtract the first time from the second. For example, `10:15:32.118` and `10:15:32.267` means the order took **149 milliseconds**. That gap covers our system plus your broker, and it leaves out your own internet connection. So if you also measure the full round trip in your own code, the difference between the two numbers is your network and your code. That is the cleanest way to find out where your time is actually going. Take an average over at least 100 orders before drawing a conclusion. A single order can be slow for reasons that have nothing to do with speed, such as the first order of the day. See [Activity screen](https://stocksdeveloper.in/documentation/user-interface/tools/activity/) and [slow performance](https://stocksdeveloper.in/knowledgebase/slow-performance/) for more. ## API Libraries Pick the library that matches your programming environment. - [HTTP REST](https://stocksdeveloper.in/documentation/client-setup/http-rest-api/) API (works from any programming language) - [Java](https://stocksdeveloper.in/documentation/client-setup/java-library/) API library - [AmiBroker](https://stocksdeveloper.in/documentation/client-setup/amibroker-library/) API library - [MetaTrader](https://stocksdeveloper.in/documentation/client-setup/metatrader-library/) API library - [Ms-Excel](https://stocksdeveloper.in/documentation/client-setup/excel-library/) API library - [C# .NET](https://stocksdeveloper.in/documentation/client-setup/c-library/) API library - [Python](https://stocksdeveloper.in/documentation/client-setup/python-library/) API library ## API Functions Click any function below to read its documentation. ### Place orders - [Place Regular Order](https://stocksdeveloper.in/documentation/api/place-regular-order/) - [Place Cover Order](https://stocksdeveloper.in/documentation/api/place-cover-order/) — your broker's own cover order - [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/) — your broker's own bracket order - [Place AutoTrader Bracket Order](https://stocksdeveloper.in/documentation/api/place-autotrader-bracket-order/) — ours, works on every broker - [Place AutoTrader Cover Order](https://stocksdeveloper.in/documentation/api/place-autotrader-cover-order/) — ours, works on every broker - [Place Advanced Order](https://stocksdeveloper.in/documentation/api/place-advanced-order/) ### Cancel orders - [Cancel Order](https://stocksdeveloper.in/documentation/api/cancel-order/) - [Cancel Child Orders](https://stocksdeveloper.in/documentation/api/cancel-child-orders/) - [Cancel All Orders](https://stocksdeveloper.in/documentation/api/cancel-all-orders/) ### Modify orders - [Modify Order](https://stocksdeveloper.in/documentation/api/modify-order/) - [Modify Order Price](https://stocksdeveloper.in/documentation/api/modify-order-price/) - [Modify Order Quantity](https://stocksdeveloper.in/documentation/api/modify-order-quantity/) ### Square-off - [Square-off Position](https://stocksdeveloper.in/documentation/api/square-off-position/) - [Square-off Portfolio](https://stocksdeveloper.in/documentation/api/square-off-portfolio/) ### Read data - [Read Orders](https://stocksdeveloper.in/documentation/api/read-orders/) - [Read Positions](https://stocksdeveloper.in/documentation/api/read-positions/) - [Read Margins](https://stocksdeveloper.in/documentation/api/read-margins/) ### Trading accounts - [Fetch All Trading Accounts](https://stocksdeveloper.in/documentation/api/fetch-all-trading-accounts/) - [Create or Update Trading Account](https://stocksdeveloper.in/documentation/api/create-or-update-trading-account/) - [Validate Trading Account Credentials](https://stocksdeveloper.in/documentation/api/validate-trading-account-credentials/) ### Reference - [API Parameters](https://stocksdeveloper.in/documentation/api/api-parameters/) - [API Rate Limits](https://stocksdeveloper.in/documentation/api/api-rate-limits/) - [Email Limits](https://stocksdeveloper.in/documentation/api/email-limits/) - [Postman](https://stocksdeveloper.in/documentation/api/postman/) ## Writing the code with an AI assistant Most people now build against this API with an AI coding assistant (ChatGPT, Claude, Gemini, Copilot, or whichever you use). It works far better if you give the tool our documentation **first** — an AI that has not read it invents function names and field values. The quickest way is to attach one ready-made file that holds this whole API reference: [stocksdeveloper.in/ai/trading-api.txt](https://stocksdeveloper.in/ai/trading-api.txt), or the smaller file for your language, such as [stocksdeveloper.in/ai/trading-api/python.txt](https://stocksdeveloper.in/ai/trading-api/python.txt). Both are built from these pages, so they are never out of date. **[Build with AI](https://stocksdeveloper.in/documentation/build-with-ai/)** has the full method — where to get the file, prompts you can copy, the mistakes these tools make, and how to check the result. Ask the tool to check its own code against the reference, then try each call once with [Postman](https://stocksdeveloper.in/documentation/api/postman/) before you run it with real money. Our support can answer anything about the API itself — what a function does, what a parameter expects, what an error means — but it is not set up to read or debug a whole program. ============================================================================== PAGE 2 OF 27 — API Parameters URL: https://stocksdeveloper.in/documentation/api/api-parameters/ Last updated: 2026-09-06 Summary: These are the standard parameters you pass to AutoTrader API functions. AutoTrader hides each broker's order, position, trade and margin formats behind one common format. You send values in this standard format, and the software converts them to the format your broker needs. ============================================================================== Every trading platform has its own format for orders, positions, trades and margins. AutoTrader's job is to hide those differences and give you a single standard format. You pass values in the standard format defined by the AutoTrader team, and the software converts them internally for your trading platform. > The AutoTrader API is offered in multiple programming languages. The descriptions below are generic and apply to all of them, so there may be small differences. Please also check the language-specific examples for your [client setup](https://stocksdeveloper.in/documentation/client-setup/). ## Order Id **Data type:** Text or String An order id uniquely identifies an order. In AutoTrader you deal with 3 types of order ids. 1. **Publisher Id** — Used in languages like AmiBroker AFL or MetaTrader MQL, where direct HTTP REST communication is not possible. This id is generated by the API functions, and AutoTrader maps it to the actual order. It may not be unique across different users, because it is generated on the client side. 2. **System Id** — When AutoTrader receives a new order, it assigns a new id. This id is unique across all users of the AutoTrader platform. 3. **Platform Id** — The id given to the order by your stock broker's trading platform. ## Account **Data type:** Text or String A nickname (also known as a [pseudo account](https://stocksdeveloper.in/documentation/broker-independence/pseudo-account/)) you have given for your broker account. The system maps it internally to an actual trading account. Taking a nickname instead of the real broker account lets you switch broker accounts from the system without changing your code. See how to [create a nickname](https://stocksdeveloper.in/documentation/user-interface/accounts/nicknames/). Depending on the client, this parameter is named `pseudoAccount` (HTTP, Java, C#), `pseudo_account` (Python), `PseudoAccount` (Excel) or simply `account` (AmiBroker, MetaTrader). Whatever the name, the value you pass is always the nickname. For example: ```shell pseudoAccount=ACC_NICK_NAME ``` **Note:** You can rename a nickname later from the [Trading Accounts](https://stocksdeveloper.in/documentation/user-interface/accounts/trading-accounts/) screen. The nickname is the name your code passes here, so if you rename it, update the name in your code to match. If you do not, your orders will fail. ## Variety **Data type:** Text or String or Enumeration Variety represents the kind of an order. | Value | Meaning | |---|---| | **REGULAR** | A regular order | | **BO** | Your broker's own bracket order — available only on brokers that offer one | | **CO** | Your broker's own cover order — available only on brokers that offer one | | **AT_BO** | An [AutoTrader bracket order](https://stocksdeveloper.in/documentation/bracket-cover-orders/) — works on every broker we support | | **AT_CO** | An [AutoTrader cover order](https://stocksdeveloper.in/documentation/bracket-cover-orders/) — works on every broker we support | `AT_BO` and `AT_CO` are our own bracket and cover orders. Your entry is placed as an ordinary intraday order and AutoTrader Web watches your target and stoploss, so they work even on brokers that do not offer bracket or cover orders. They are always intraday, they do not give the extra margin some brokers give on their own bracket orders, and the position is squared off automatically before the market closes. See [Bracket & Cover Orders](https://stocksdeveloper.in/documentation/bracket-cover-orders/). ## Exchange **Data type:** Text or String or Enumeration An exchange represents the Indian stock exchange on which the order symbol is traded. Pass the standard code for the relevant exchange and market segment, for example the cash segment, the F&O segment or the commodity segment. ## Symbol **Data type:** Text or String A symbol represents a stock or derivative contract. The symbol must be a [broker independent symbol](https://stocksdeveloper.in/documentation/broker-independence/instruments-symbols/). You can use this [Indian API stock symbol search tool](https://stocksdeveloper.in/knowledgebase/instrument-not-found/). ## Trade Type **Data type:** Text or String or Enumeration Represents a trade type, sometimes called transaction type. The valid trade types are: | Value | Meaning | |---|---| | **BUY** | A buy order | | **SELL** | A sell order | | **SHORT** | A sell order (added for charting software support — only allowed in the CSV format used by the AmiBroker, MetaTrader and Excel libraries) | | **COVER** | A buy order (added for charting software support — only allowed in the CSV format used by the AmiBroker, MetaTrader and Excel libraries) | ## Order Type **Data type:** Text or String or Enumeration Represents an order type. There are 4 valid order types. | Value | Meaning | |---|---| | **LIMIT** | A limit order | | **MARKET** | A market order | | **STOP\_LOSS** | A stoploss order | | **SL\_MARKET** | A stoploss market order | ## Product Type **Data type:** Text or String or Enumeration Represents a product type. There are 4 valid product types. | Value | Meaning | |---|---| | **INTRADAY** | An intraday or MIS order | | **DELIVERY** | A delivery order | | **NORMAL** | A normal order | | **MTF** | A margin trading facility order (also known as buy now pay later). Supported only by brokers that offer MTF. | ## Validity **Data type:** Text or String or Enumeration Represents order validity. There are 2 valid values. | Value | Meaning | |---|---| | **DAY** | Order is valid for the day (this is the default) | | **IOC** | Immediate or cancel | **Note:** Do not confuse Validity with Product Type. They are different things. ## Quantity **Data type:** Numeric or Integer AutoTrader passes the quantity as it is to the trading platform. The confusion usually happens for derivatives: should you pass quantity as a multiple of lot size, or as a number of lots? All trading platforms supported by AutoTrader take quantity **in multiple of lot size**. **Example:** To buy 1 lot of NIFTY Future (assuming a lot size of 65), enter the quantity as: **\= (#lots \* lots\_size) = (1 \* 65) = 65** Lot sizes are revised from time to time, so always check the current lot size of the contract you are trading. ### Commodity contracts: an optional setting changes this There is one setting that changes how quantity is counted, and **only** for commodity contracts. **Commodity Quantity in Lots**, in **Settings → General**, under **Trading**. It is **off by default**, so nothing changes unless you switch it on yourself. | Setting | What to send for a commodity contract | | --- | --- | | Off (default) | The quantity as a multiple of lot size, exactly as above | | On | The **number of lots** | **Example:** for a commodity contract whose lot size is 250, to buy 1 lot you send **250** with the setting off, and **1** with it on. **This setting applies to your API orders, not only to orders you place on the website.** It is stored against your account, so switching it on changes what every one of your programs is sending — the API, a chart bridge, or anything else. **Update your program before you switch it on.** If it keeps sending its usual quantity, that number will be read as that many lots. Contracts whose lot size is 1 are unaffected either way. The setting exists because broker APIs do not agree with each other. For the same commodity contract, some count in lots and some count in units, so the same number meant different sizes at different brokers. Sending the number of lots means one number means one thing whichever broker the account belongs to, and AutoTrader converts it to whatever that broker's API expects. The unit you send is also the unit you **read back**. With the setting on, orders and positions report commodity quantity in lots, so a quantity you read can be sent straight back to any endpoint that takes one. ## Disclosed Quantity **Data type:** Numeric or Integer Represents a disclosed quantity. It is optional and defaults to zero. It follows the same unit as Quantity, so on a commodity contract it is a number of lots when **Commodity Quantity in Lots** is on. ## Price **Data type:** Decimal or Float Represents the order price. For a market order, this price defaults to zero. **Note:** Price is automatically rounded to the nearest tick price, so you need not worry about price being a multiple of tick size. Example: a price of 50.54 with a tick size of 0.05 becomes 50.55. ## Trigger Price **Data type:** Decimal or Float Represents a trigger price. It is used in a stoploss order or a cover order. For a **cover order**, this is the actual price your stop-loss sits at. It is a price, not a distance. This is worth remembering, because a bracket order works the other way round: its stoploss is a distance from your entry, not a price. See **Stoploss (Bracket Order)** below. **Note:** Trigger price is automatically rounded to the nearest tick price, so you need not worry about it being a multiple of tick size. Example: a price of 50.54 with a tick size of 0.05 becomes 50.55. ⚠️ **On a `STOP_LOSS` order, the two prices must point the right way round.** `price` is the limit price and `triggerPrice` is the level that activates the order, and the limit has to allow the direction the order will trade in: | Trade type | Required | |---|---| | `SELL` | `price` at or **below** `triggerPrice` | | `BUY` | `price` at or **above** `triggerPrice` | Equal prices are allowed. Send them the wrong way round and the request is rejected with a message naming both prices and the direction required, on **place and on modify**. A `SL_MARKET` order has no limit price, so only `triggerPrice` applies to it. **On modify, send both prices together when you move a stop.** A modify carries only the fields you change, so passing `triggerPrice` alone leaves the order's existing limit price beside your new trigger. Move it far enough and the two cross. See [Trigger price rejected](https://stocksdeveloper.in/knowledgebase/trigger-price-rejected/). ## Target (Bracket Order) **Data type:** Decimal or Float Represents the target of a bracket order, as a **distance from your entry price**. It is not the price you want to exit at. Example: you buy at 180.50 and pass `target=5`. Your target sits at 185.50, which is 5 above your entry. A common mistake is to pass the exit price itself. If you want to exit at 185.50 after buying at 180.50, pass `target=5`, not `target=185.5` — the second one asks for a target 185.50 away from your entry. On a sell order the target sits **below** your entry, because that is the profitable side. You still pass the same positive distance. The same value and the same meaning apply to an [AutoTrader bracket order](https://stocksdeveloper.in/documentation/api/place-autotrader-bracket-order/) (`AT_BO`). An AutoTrader **cover** order (`AT_CO`) has no target. ## Stoploss (Bracket Order) **Data type:** Decimal or Float Represents the stoploss of a bracket order, as a **distance from your entry price**. It is not the price you want your stop to sit at. Example: you buy at 180.50 and pass `stoploss=2.5`. Your stop sits at 178.00, which is 2.50 below your entry. On a sell order the stop sits **above** your entry. You still pass the same positive distance. The same value and the same meaning apply to an [AutoTrader bracket order](https://stocksdeveloper.in/documentation/api/place-autotrader-bracket-order/) (`AT_BO`) **and** to an [AutoTrader cover order](https://stocksdeveloper.in/documentation/api/place-autotrader-cover-order/) (`AT_CO`). ⚠️ **Note the difference from your broker's cover order.** On a `CO` the stop is given as a real price, in **Trigger Price** above. On an `AT_CO` it is given here, as a distance from your entry price — and there is no trigger price at all. Passing a stop price where a distance is expected is the one mistake worth checking for when you move a cover order across. ## Trailing Stoploss (Bracket Order) **Data type:** Decimal or Float Represents the trailing stoploss of a bracket order: the **step** your stop-loss moves by as the price moves in your favour. Like the two values above, it is a distance, not a price. It only ever moves your stop closer to the current price, never further away. Example: you buy at 180.50 with `stoploss=2.5` and `trailingStoploss=1`. Your stop starts at 178.00, and moves up in steps of 1 as the price rises. Pass it as a **rupee amount** — for example, 1 for a one-rupee step. Some brokers work a little differently. Their own system takes the trailing stoploss as a **number of ticks**. On such a system, a one-rupee step on an instrument with a tick size of 0.05 would have to be entered as 20, calculated as 1 divided by 0.05. You do not need to do that here. Because AutoTrader is broker independent, always pass the rupee amount. The software reads the tick size and converts it into ticks for you where the broker needs it. **A trailing stoploss needs a stoploss with it.** The stoploss says how far behind the price your stop sits; the trailing stoploss says how much it moves each step. On its own, a trailing value cannot say both, so an order carrying only a trailing stoploss is rejected before it is placed. This applies to bracket orders, AutoTrader bracket and cover orders, and alerts alike. **The stop moves in whole steps.** Buy at 100 with `stoploss=10` and `trailingStoploss=2`: the stop starts at 90, is still 90 when the price reaches 101, and moves to 92 once the price reaches 102. You can try this on the [Bracket & Cover Orders](https://stocksdeveloper.in/documentation/bracket-cover-orders/) page. ## AMO **Data type:** Text or String or Boolean Indicates whether an order is an **A**fter **M**arket **O**rder. | Value | Meaning | |---|---| | **TRUE** | The order is an AMO | | **FALSE** | The order is not an AMO (this is the default) | ## Validate **Data type:** Boolean This parameter is only used in AmiBroker. When set to **True**, the system will not accept back to back BUY or back to back SELL orders. It treats them as duplicate orders caused by a known limitation of AmiBroker. When you get a signal in AmiBroker, it stays active until the candle completes. Every time the strategy runs during this active state, it sees the signal is active and places an order, which results in duplicate orders. AmiBroker experts can set it to **False** and manage the signal in their own strategy code. This simple flag was built for beginners. ## OrderStatus **Data type:** Text or String or Enumeration Represents order status in a broker-independent way. Broker-specific statuses are not uniform, so AutoTrader parses them into a standard status. | Value | Meaning | |---|---| | **OPEN** | Open | | **COMPLETE** | Complete | | **CANCELLED** | Cancelled | | **REJECTED** | Rejected | | **TRIGGER\_PENDING** | Trigger pending | | **UNKNOWN** | Unknown (when the system cannot determine the type from the raw order status received from the stock broker) | ## MarginCategory **Data type:** Text or String or Enumeration Represents margin category. | Value | Meaning | |---|---| | **EQUITY** | Margin for the Equity section of your account | | **COMMODITY** | Margin for the Commodity section of your account | | **ALL** | Combined margin for Equity and Commodity | ## PositionCategory **Data type:** Text or String or Enumeration Represents position category. | Value | Meaning | |---|---| | **DAY** | Snapshot of the buying and selling activity for that particular day | | **NET** | Actual or current net position | Not every broker sends both. Some brokers give **NET** only, so a read scoped to **DAY** returns nothing for those accounts. **NET** works for every broker, so prefer it unless you specifically need today's activity on its own. See [precautions](https://stocksdeveloper.in/documentation/precautions/) for the brokers this applies to. ## PositionType **Data type:** Text or String or Enumeration Represents position type. | Value | Meaning | |---|---| | **MIS** | MIS or intraday position | | **CNC** | CNC or delivery position | | **NRML** | Normal position position | | **BO** | BracketOrder position | | **CO** | CoverOrder position | ## PositionState **Data type:** Text or String or Enumeration Represents the state of the position, which can be either OPEN or CLOSED. | Value | Meaning | |---|---| | **OPEN** | The position is open | | **CLOSED** | The position is closed | ## PositionDirection **Data type:** Text or String or Enumeration Represents the direction of the position. | Value | Meaning | |---|---| | **LONG** | A long position | | **SHORT** | A short position | | **NEUTRAL** | A neutral position | ## Related pages - [API Rate Limits](https://stocksdeveloper.in/documentation/api/api-rate-limits/) - [Place Regular Order](https://stocksdeveloper.in/documentation/api/place-regular-order/) - [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/) - [Place Cover Order](https://stocksdeveloper.in/documentation/api/place-cover-order/) - [Read Positions](https://stocksdeveloper.in/documentation/api/read-positions/) - [Read Margins](https://stocksdeveloper.in/documentation/api/read-margins/) ============================================================================== PAGE 3 OF 27 — API Rate Limits URL: https://stocksdeveloper.in/documentation/api/api-rate-limits/ Last updated: 2026-09-06 Summary: Every action (placing an order, reading the orderbook, reading positions, and so on) sends one request per account to your broker's server. To protect those servers, we apply rate limits at two levels: user level and pseudo/trading account level. Cross any limit and you get a `429 Too Many Requests` error. The limits are generous, so a breach usually means a bug in your strategy code. ============================================================================== API stands for Application Programming Interface. In simple words, every action you do (placing an order, reading the orderbook or positionbook, and so on) creates one request per account. Each request talks to your stock broker's server to place an order, read portfolio data, and similar tasks. Too many requests in a short time can affect a server's performance. So both we and your brokers set limits on how many requests can be sent. These API limits mainly affect API users doing automated trading. Manual traders are unlikely to face this issue unless they send a lot of orders in bulk. If a manual trader does hit a limit, they should report it to support. ## Why rate limits exist There are two main reasons for rate limits: - Bad code written by a user that calls API functions continuously in a loop - A malicious user trying a DOS attack > As an API user, you need to understand that this is the most important feature **for you as well**. An API breach is almost always caused by a bug in the user's strategy code. API limits help you safeguard yourself. We have seen users suffer heavy losses because their rogue code kept firing orders, when they used APIs that do not have such limits. > > Admin ## Limits If your system crosses **any** of the limits below, you will receive a server error: [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). ### User level This applies at the user level, so requests for all accounts are counted together. | Limit | Time interval | |---|---| | 500 requests | per 5 seconds | | 1500 requests | per 1 minute | ### Pseudo / trading account level This applies at the pseudo/trading account level, so only requests for a single pseudo/trading account are counted. | Limit | Time interval | |---|---| | 60 requests | per 5 seconds | | 130 requests | per 1 minute | | 300 requests | per 5 minutes | ### How limits are calculated Every API request made to the AutoTrader Server counts as 1 unit. The common requests are: - Place Order - Modify Order - Cancel Order - Read Positions - Read Orders - Read Margins #### Charting and spreadsheet libraries The AmiBroker, MetaTrader and Excel libraries read your portfolio only when your strategy asks for a value, and they keep a short-lived copy of what they read. So a strategy that reads twenty different fields on one bar makes one request per dataset, not twenty. How long that copy is re-used is set in the library's own settings file, and the defaults are chosen to sit inside the limits. Orders and positions are refreshed every 2 seconds, margins every 30 seconds, and holdings every 5 minutes. ## Guidelines for staying within API limits ### Manual trading (website users) Manual traders are unlikely to breach limits unless they have **100+ accounts** under them. Here is an example. Assume you have 100 live accounts under you. When you place an order, or refresh a screen (positions, orders, margins, and so on), it creates: - 1 request for each trading account - 100 requests under your user When does a breach happen? - The 5-second user-level limit is 500. If you refresh the screen 6 times within 5 seconds, that is 600 requests in 5 seconds, which breaches the limit. - The 1-minute user-level limit is 1500. If you refresh the screen 16 times within 1 minute, that is 1600 requests in 1 minute, which breaches the limit. Based on how many accounts you trade, you can work out how many operations you can do within the limits. As a general rule, do not go too close to the limits. ### Automated trading (API users) The limits are set to a reasonable value. If your code is breaking them, check that it is not doing something wrong or redundant. - Keep only those pseudo accounts live that your strategy actually uses. - If you are using the AmiBroker, MetaTrader or Excel library: - Leave the refresh settings alone unless you have a reason. Lowering them does not get you fresher data; the server answers anything faster than about one request a second per account from its own copy. - Raise them if you trade slowly and want less traffic. - Close charts you are not using. Each running strategy reads for itself. - If you write your own code: - Cache the portfolio in your strategy and refresh it periodically, or only when needed. - If your strategy creates many orders in a short time, add some delay in your code to avoid hitting the limits. ## Breach of limit A breach is a serious issue. It puts load on our servers and affects other clients. Worse, if a broker's RMS (Risk Management System) has bugs, a breach could send too many orders to the exchange, which in rare cases can cause far bigger problems. The load from one user's badly written code can affect all of our clients if we do not keep API rate limits in place. > Whenever a breach happens, the extra requests are rejected with a `429 Too Many Requests` error and we send you an email about it. Your user account stays active, so you can keep trading. The user is expected to explain the cause and the fixes to avoid hitting API limits again. If a user keeps breaching the limits or fails to cooperate with the support team, their access will be permanently revoked. > > Admin **Note:** If we ever have to disable your AutoTrader Web user, it does not mean you cannot trade. You can always log in to your stock broker's trading terminal and operate your trading account. API limits protect stock exchanges and their systems, stock brokers and their systems, our own systems, and all market participants (traders and investors). So we have a zero-tolerance policy for users who fail to cooperate when a breach happens. ## Industry standards API rate limits are a standard practice in the industry, though not every user is aware of it. Most major brokers and trading platforms publish similar order and request rate limits in their own API documentation. ## Related pages - [API documentation](https://stocksdeveloper.in/documentation/api/) - [API parameters](https://stocksdeveloper.in/documentation/api/api-parameters/) - [Client setup](https://stocksdeveloper.in/documentation/client-setup/) - [Brokers API access rate limits breached](https://stocksdeveloper.in/knowledgebase/brokers-api-access-rate-limits-breached/) - [Pseudo account](https://stocksdeveloper.in/documentation/broker-independence/pseudo-account/) ============================================================================== PAGE 4 OF 27 — Cancel All Orders URL: https://stocksdeveloper.in/documentation/api/cancel-all-orders/ Last updated: 2026-07-27 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/cancelAllOrders Returns: true on success Summary: The Cancel All Orders call cancels every open order for a given pseudo account in one call. A common use is to clear all pending orders before you start an intraday square-off. It is available in HTTP REST, Python, Java, C#, Excel, AmiBroker, and MetaTrader, and it returns true on success. ============================================================================== This call cancels all open orders for the given pseudo account. It is available in HTTP REST, Python, Java, C#, Excel, AmiBroker, and MetaTrader. For related calls, see [Cancel Order](https://stocksdeveloper.in/documentation/api/cancel-order/) and [Cancel Child Orders](https://stocksdeveloper.in/documentation/api/cancel-child-orders/). ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/cancelAllOrders \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" ``` ### Response ```json { "result":true, "error":null, "message":null, "status":true, "commandId":"6d4b5124-c1aa-4623-b0c5-8df779e0f44d" } ``` ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. ## Parameters | Parameter | Description | | --- | --- | | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes To cancel a single order, see [Cancel Order](https://stocksdeveloper.in/documentation/api/cancel-order/). To exit a bracket or cover order, see [Cancel Child Orders](https://stocksdeveloper.in/documentation/api/cancel-child-orders/). To flatten an entire portfolio, see [Square Off Portfolio](https://stocksdeveloper.in/documentation/api/square-off-portfolio/). ============================================================================== PAGE 5 OF 27 — Cancel Child Orders URL: https://stocksdeveloper.in/documentation/api/cancel-child-orders/ Last updated: 2026-07-27 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/cancelChildOrdersByPlatformId Returns: true on success Summary: The Cancel Child Orders call exits an open bracket or cover order. You pass the parent order id, and the system cancels its stoploss child orders. Your broker then cancels the matching target order and squares off the position at market price. It is available in HTTP REST, Python, Java, C#, Excel, AmiBroker, and MetaTrader, and it returns true on success. ============================================================================== This call exits an open [bracket order](https://stocksdeveloper.in/documentation/api/place-bracket-order/) or [cover order](https://stocksdeveloper.in/documentation/api/place-cover-order/) position. It is available in HTTP REST, Python, Java, C#, Excel, AmiBroker, and MetaTrader. For related calls, see [Cancel Order](https://stocksdeveloper.in/documentation/api/cancel-order/) and [Cancel All Orders](https://stocksdeveloper.in/documentation/api/cancel-all-orders/). ## How it works When you place a bracket or cover order (the **parent order**) and it gets executed, one or more **child** orders are generated. These are your stoploss and/or target orders. This function accepts a parent order id and cancels its children: 1. Find all stoploss child orders. 2. Cancel them. After the stoploss child orders are cancelled: - The matching target order is cancelled by your stock broker (for a bracket order). - The position is squared off at market price by your stock broker. You see the same behaviour when you do this directly on your trading platform. So the cancel child order function is also called the **exit bracket or cover order** function. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/cancelChildOrdersByPlatformId \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" \ -d "platformId=" ``` ### Response ```json { "result":true, "error":null, "message":null, "status":true, "commandId":"6d4b5738-c1aa-4623-b0c5-8df779e0f44d" } ``` ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. ## Parameters | Parameter | Description | | --- | --- | | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | orderId | parent order id given by the `placeOrder*()` function. AmiBroker, Excel and MetaTrader use the [publisherId](https://stocksdeveloper.in/documentation/api/api-parameters#order-id); Java, HTTP, C# and Python use the [platformId](https://stocksdeveloper.in/documentation/api/api-parameters#order-id). | ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes To cancel a single open order, see [Cancel Order](https://stocksdeveloper.in/documentation/api/cancel-order/). To cancel every open order for an account, see [Cancel All Orders](https://stocksdeveloper.in/documentation/api/cancel-all-orders/). ============================================================================== PAGE 6 OF 27 — Cancel Order URL: https://stocksdeveloper.in/documentation/api/cancel-order/ Last updated: 2026-07-27 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/cancelOrderByPlatformId Returns: true on success Summary: The Cancel Order call cancels an open order using its order id. It works the same way across every supported broker, so you write the call once. The same function is available in HTTP REST, Python, Java, C#, Excel, AmiBroker, and MetaTrader. It returns true on success and false otherwise. ============================================================================== This call cancels an open order using its order id. It is available in HTTP REST, Python, Java, C#, Excel, AmiBroker, and MetaTrader. For related calls, see [Cancel All Orders](https://stocksdeveloper.in/documentation/api/cancel-all-orders/) and [Cancel Child Orders](https://stocksdeveloper.in/documentation/api/cancel-child-orders/). ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/cancelOrderByPlatformId \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" \ -d "platformId=" ``` ### Response ```json { "result":true, "error":null, "message":null, "status":true, "commandId":"6d4b5738-c1aa-4623-b0c5-8df779e0f44d" } ``` ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. ## Parameters | Parameter | Description | | --- | --- | | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | orderId | order id given by the `placeOrder*()` function. AmiBroker, Excel and MetaTrader use the [publisherId](https://stocksdeveloper.in/documentation/api/api-parameters#order-id); Java, HTTP, C# and Python use the [platformId](https://stocksdeveloper.in/documentation/api/api-parameters#order-id). | ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes To cancel every open order for an account in one call, see [Cancel All Orders](https://stocksdeveloper.in/documentation/api/cancel-all-orders/). To exit a bracket or cover order, see [Cancel Child Orders](https://stocksdeveloper.in/documentation/api/cancel-child-orders/). ============================================================================== PAGE 7 OF 27 — Create or Update Trading Account URL: https://stocksdeveloper.in/documentation/api/create-or-update-trading-account/ Last updated: 2026-08-08 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/account/createTradingAccount Returns: a trading account id Summary: Use these calls to add a broker trading account to AutoTrader Web, or to update one that already exists. There are two endpoints, `createTradingAccount` and `updateTradingAccount`. The login parameters change from broker to broker, so this page explains the common fields and the broker specific fields each account needs. On success the call returns a trading account id. ============================================================================== This call adds a new broker trading account, or updates an existing one. It is available over the HTTP REST API and is mainly for developers building their own apps on top of our [broker independent trading APIs](https://stocksdeveloper.in/documentation/broker-independence/). There are two separate endpoints: | Endpoint | Use it to | | --- | --- | | `createTradingAccount` | Add a new trading account | | `updateTradingAccount` | Modify an existing trading account | ## HTTP ### Example Create a new account: ```shell curl https://apix.stocksdeveloper.in/account/createTradingAccount \ -H "api-key: " \ -d "broker=YOUR_BROKER" \ -d "platform=PLATFORM" \ -d "loginId=" \ -d "password=" \ -d "totpKey=" \ -d "pseudoAccName=" ``` Update an existing account (pass the trading account `id`): ```shell curl https://apix.stocksdeveloper.in/account/updateTradingAccount \ -H "api-key: " \ -d "id=" \ -d "broker=YOUR_BROKER" \ -d "platform=PLATFORM" \ -d "loginId=" \ -d "password=" \ -d "totpKey=" ``` ### Response On success: ```json { "result": 15937688, "message": "Account saved successfully.", "status": true, "commandId": null } ``` On failure: ```json { "result": null, "message": "Account already exists! Either you or some other user has already added this account in our system. Please contact support.", "status": false, "commandId": null } ``` The response fields work as follows: | Field | Meaning | | --- | --- | | `result` | Unique trading account id generated by AutoTrader Web (Number, Long). On failure this is `null`. | | `message` | Success or error message. | | `status` | `true` on success, `false` on failure. | ## Parameters ### Common parameters A few parameters are the same across all brokers. | Parameter | Description | | --- | --- | | `id` | Unique trading account id generated by AutoTrader Web (Number, Long). Get it from the [Fetch All Trading Accounts API](https://stocksdeveloper.in/documentation/api/fetch-all-trading-accounts/) (the `systemId` field). Mandatory for **Update**, not needed for **Create**. | | `pseudoAccName` | Pseudo or nickname for the account. Used only for **Create**, and it is optional. If you do not pass it, the login id of the trading account is used as the nickname. Not needed for **Update**. | ### Broker specific parameters All other parameters are broker specific, because every broker has a different login mechanism. Each account needs: - `broker` — the broker name, as listed on the [supported brokers](https://stocksdeveloper.in/documentation/supported-brokers/) page. - `platform` — the broker platform code that goes with that broker. - A set of credential fields that depend on the broker. Depending on the broker these may include `loginId`, `password`, `mpin`, `totpKey`, `dob`, `phone`, `token`, and various API key, secret and id fields issued by the broker. For the exact `broker` value, `platform` code and the full credential field list for your broker, see your broker's setup guide under [client setup](https://stocksdeveloper.in/documentation/client-setup/) or contact support. ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes This call is not meant to be made repeatedly, so it has stricter limits than the other APIs. See [API rate limits](https://stocksdeveloper.in/documentation/api/api-rate-limits/) for the full list. After adding an account, you can confirm it with [Fetch All Trading Accounts](https://stocksdeveloper.in/documentation/api/fetch-all-trading-accounts/) and check the credentials with [Validate Trading Account Credentials](https://stocksdeveloper.in/documentation/api/validate-trading-account-credentials/). ## Notes - **Needs a recent library version.** These calls are available in **Python 1.5.0**, **Java 3.3.0** and **C# 1.5.0** or newer. If your editor does not offer the function, upgrade the library — see [client setup](https://stocksdeveloper.in/documentation/client-setup/). The HTTP REST calls need nothing installed. - **Not available in Excel, AmiBroker or MetaTrader.** Use the HTTP REST calls there. - The fields are passed as a map or dictionary rather than fixed arguments, because they differ per broker and platform. A fixed signature would have to change every time a broker is added. ============================================================================== PAGE 8 OF 27 — Email Limits URL: https://stocksdeveloper.in/documentation/api/email-limits/ Last updated: 2026-06-20 Summary: Email alerts have rate limits: at most 1 email per second, 2 per minute, and 6 per hour for each user. These caps protect the shared mail service so one user cannot stop alerts from reaching everyone else. If you cross a limit, alerts pause until that limit interval ends. ============================================================================== Email alerts on Stocks Developer have rate limits. The mail service provider sets limits on how many emails can be sent in total. To stay within those limits, we cap the alerts each user can receive. This keeps the service fair, so no single user can use up most of the capacity and break email for all other clients. ## Limits | Time window | Maximum emails | |---|---| | Per second | 1 | | Per minute | 2 | | Per hour | 6 | If a user account crosses any of these limits, it will not receive email alerts until the limit interval is complete. ============================================================================== PAGE 9 OF 27 — Fetch All Trading Accounts URL: https://stocksdeveloper.in/documentation/api/fetch-all-trading-accounts/ Last updated: 2026-08-08 HTTP method: GET HTTP endpoint: https://apix.stocksdeveloper.in/account/fetchAllTradingAccounts Returns: your trading accounts Summary: This call returns the details of every trading account under your user, such as login id, broker, platform, live status and license dates. It is meant for developers building custom apps on our broker independent trading APIs. It never returns sensitive data like passwords or security answers. ============================================================================== This call fetches the details of all trading accounts available under your user. It is available over the HTTP REST API and is primarily for developers building custom apps on our [broker independent trading APIs](https://stocksdeveloper.in/documentation/broker-independence/api-functions/). It never returns sensitive details like password, security answer or similar fields. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/account/fetchAllTradingAccounts \ -H "api-key: " ``` The response is JSON, in the format shown under [Response](https://stocksdeveloper.in/documentation/api/fetch-all-trading-accounts/#response). Each account carries the [Account fields](https://stocksdeveloper.in/documentation/api/fetch-all-trading-accounts/#account-fields) listed below. ## Response On success the `result` field is a list of trading account objects: ```json { "result": [ { "loginId": "229004", "pseudoAccName": "ACC-1", "broker": "YOUR_BROKER", "platform": "PLATFORM", "licenseExpiryDate": "20-Sep-2023", "live": false, "systemId": 20739003, "systemIdOfPseudoAcc": 20739004, "licenseDaysLeft": 0 }, { "loginId": "AR291", "pseudoAccName": "ACC-2", "broker": "YOUR_BROKER", "platform": "PLATFORM", "licenseExpiryDate": "24-Jun-2023", "live": false, "systemId": 16638672, "systemIdOfPseudoAcc": 16638673, "licenseDaysLeft": 0 } ], "message": null, "status": true, "commandId": null } ``` On failure: ```json { "result": null, "message": "429 - Too many requests", "status": false, "commandId": null } ``` `status` is `true` on success. On error it is `false`, and `message` holds the error text. ## Account fields Each trading account in the `result` list carries the fields below. | Field | Type | Description | | --- | --- | --- | | `loginId` | string | Login id of the trading account. | | `pseudoAccName` | string | Pseudo name (nickname). | | `broker` | string | Stock broker name. | | `platform` | string | Stock broker platform. | | `live` | boolean | Whether the account is live. Non-live accounts are not available for trading. | | `licenseExpiryDate` | string | License expiry date in `dd-MMM-yyyy` format. | | `licenseDaysLeft` | int | License days left. | | `systemId` | long | Internal id given by AutoTrader Web that uniquely identifies the trading account. | | `systemIdOfPseudoAcc` | long | Internal id given by AutoTrader Web that uniquely identifies the pseudo account. | To understand the difference between a trading account and a pseudo account, see the [pseudo account](https://stocksdeveloper.in/documentation/broker-independence/pseudo-account/) guide. ## Notes This call is not expected to be used repeatedly, so it has stricter limits than the other APIs. See [API rate limits](https://stocksdeveloper.in/documentation/api/api-rate-limits/) for the full list. ## Notes - **Needs a recent library version.** These calls are available in **Python 1.5.0**, **Java 3.3.0** and **C# 1.5.0** or newer. If your editor does not offer the function, upgrade the library — see [client setup](https://stocksdeveloper.in/documentation/client-setup/). The HTTP REST calls need nothing installed. - **Not available in Excel, AmiBroker or MetaTrader.** Use the HTTP REST calls there. ============================================================================== PAGE 10 OF 27 — Fetch Live Pseudo Accounts URL: https://stocksdeveloper.in/documentation/api/fetch-live-pseudo-accounts/ Last updated: 2026-08-08 HTTP method: GET HTTP endpoint: https://apix.stocksdeveloper.in/account/fetchLivePseudoAccounts Returns: your live pseudo account names Summary: This call returns the names of the pseudo accounts that are live under your user. A pseudo account is the nickname you trade under, and it is the value every order function expects as its first argument. Only live accounts can place orders, so calling this at the start of a run tells your code which accounts are usable that day. It is available in Python, Java, C# and the HTTP REST API, and returns a plain list of names. ============================================================================== This call returns the **live pseudo accounts** under your user. A [pseudo account](https://stocksdeveloper.in/documentation/broker-independence/pseudo-account/) is the nickname you give a trading account, and it is what every order function takes as its first argument. An account is **live** when it is logged in and able to trade; an account that is logged out, expired or disabled is not returned. Calling this once when your strategy starts is the simplest way to know which accounts you can actually place orders against today, instead of discovering it from a rejected order. To get the full details of every account — broker, platform, licence dates, and non-live accounts too — use [Fetch All Trading Accounts](https://stocksdeveloper.in/documentation/api/fetch-all-trading-accounts/) instead. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/account/fetchLivePseudoAccounts \ -H "api-key: " ``` ### Response On success the `result` field is a list of pseudo account names: ```json { "result": ["ACC_NICK_NAME", "ANOTHER_ACCOUNT"], "message": null, "status": true, "commandId": null } ``` An empty list means no account is live at the moment. That is a normal answer, not an error — the usual reasons are that the market session has not started, or an account needs its credentials refreshed. [Validate Trading Account Credentials](https://stocksdeveloper.in/documentation/api/validate-trading-account-credentials/) tells you which one. ## Notes - **Python needs 1.5.0 or newer**, where this call was added. The Java and C# libraries have had it for much longer, so any current version will do. If your editor does not offer the function, upgrade the library — see [client setup](https://stocksdeveloper.in/documentation/client-setup/). The HTTP REST call needs nothing installed. - **Not available in Excel, AmiBroker or MetaTrader.** Use the HTTP REST call there. - The names returned are exactly what the order functions expect, so you can pass them straight through. ============================================================================== PAGE 11 OF 27 — Modify Order URL: https://stocksdeveloper.in/documentation/api/modify-order/ Last updated: 2026-09-06 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/modifyOrderByPlatformId Returns: true on success Summary: The Modify Order call changes an open order's type, quantity, price or trigger price. Pass a blank string or zero for any parameter you do not want to change. The same call works across every client language and every supported broker. It returns true on success and false on failure. ============================================================================== This call modifies an open order's attributes such as order type, quantity, price and trigger price. It is available in HTTP REST, Python, Java, C#, Excel, AmiBroker, and MetaTrader. To change only the price or only the quantity, see [Modify Order Price](https://stocksdeveloper.in/documentation/api/modify-order-price/) and [Modify Order Quantity](https://stocksdeveloper.in/documentation/api/modify-order-quantity/). ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/modifyOrderByPlatformId \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" \ -d "platformId=120022012211" \ -d "orderType=MARKET" \ -d "quantity=20" \ -d "price=0" \ -d "triggerPrice=0" ``` To skip a parameter, pass a blank string for text parameters or zero for numeric parameters. ### Response ```json { "result":true, "error":null, "message":null, "status":true, "commandId":"6d4b5738-c1aa-4623-b0c5-8df779e0f44d" } ``` `status` is `true` on success. On error it is `false`, and `message` holds the error text. ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. In this example, we change the order type from **LIMIT to MARKET**, the quantity from **10 to 20** and the price from **100.5 to 0**. ## Parameters | Parameter | Description | Skip a change by passing | | --- | --- | --- | | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | — | | orderType | [order type](https://stocksdeveloper.in/documentation/api/api-parameters#order-type) | blank or NULL | | quantity | [quantity](https://stocksdeveloper.in/documentation/api/api-parameters#quantity) | zero | | price | order [price](https://stocksdeveloper.in/documentation/api/api-parameters#price) | zero | | triggerPrice | [trigger price](https://stocksdeveloper.in/documentation/api/api-parameters#trigger-price) | zero | **Note on quantity:** For derivatives on Indian stock exchanges, quantity should be a multiple of the lot size. For example, if a contract's lot size is 15, then to buy or sell 1 lot you enter 15 quantity. ### orderId by language | Languages | orderId value | | --- | --- | | AmiBroker, Excel, MetaTrader | [publisherId](https://stocksdeveloper.in/documentation/api/api-parameters#order-id) (orderId given by the placeOrder*() function) | | Java, HTTP, C#, Python | [platformId](https://stocksdeveloper.in/documentation/api/api-parameters#order-id) (orderId given by the placeOrder*() function) | ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes For AmiBroker, Excel and MetaTrader, this call returns `true` when the change is confirmed, otherwise `false`. For Java, HTTP, C# and Python, it returns a response object whose result is `true` on success and `false` otherwise. Every broker limits how many times a single order can be modified. This limit changes from one broker to another, so please ask your specific broker for details. Make sure your code does not send a modify request for the same order beyond that limit. In such cases, cancel the order and place a fresh one. Once modified, you can track the order with [Read Orders](https://stocksdeveloper.in/documentation/api/read-orders/) or stop it with [Cancel Order](https://stocksdeveloper.in/documentation/api/cancel-order/). ============================================================================== PAGE 12 OF 27 — Modify Order Price URL: https://stocksdeveloper.in/documentation/api/modify-order-price/ Last updated: 2026-09-06 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/modifyOrderPrice Returns: true on success Summary: The Modify Order Price call changes the price of an order you already placed. You pass the account, the order id returned by placeOrder, and the new price. It works the same way across the AmiBroker, Excel and MetaTrader APIs and returns true on successful submission. ============================================================================== This call modifies the price of an open order. It is available in AmiBroker, Excel, and MetaTrader. To change more than just the price, see [Modify Order](https://stocksdeveloper.in/documentation/api/modify-order/). ## Parameters | Parameter | Description | | --- | --- | | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | orderId | [publisherId](https://stocksdeveloper.in/documentation/api/api-parameters#order-id) — the orderId returned by the placeOrder*() function | | price | order [price](https://stocksdeveloper.in/documentation/api/api-parameters#price) (pass zero if you don't want to change it) | ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes This call sends the modify order price request to AutoTrader Web, which passes it on to your broker. It returns `true` when the change is confirmed, otherwise `false`. See also [Modify Order Quantity](https://stocksdeveloper.in/documentation/api/modify-order-quantity/), [Modify Order](https://stocksdeveloper.in/documentation/api/modify-order/), and [Cancel Order](https://stocksdeveloper.in/documentation/api/cancel-order/). ============================================================================== PAGE 13 OF 27 — Modify Order Quantity URL: https://stocksdeveloper.in/documentation/api/modify-order-quantity/ Last updated: 2026-09-06 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/modifyOrderQuantity Returns: true on success Summary: The Modify Order Quantity call changes the quantity of an order you already placed. You pass the account, the order id returned by placeOrder, and the new quantity. It returns true on success and false on failure. ============================================================================== This call modifies the quantity of an open order. It is available in AmiBroker, Excel, and MetaTrader. To change the price of an open order instead, see [Modify Order Price](https://stocksdeveloper.in/documentation/api/modify-order-price/). ## Parameters | Parameter | Description | | --- | --- | | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | orderId | [publisherId](https://stocksdeveloper.in/documentation/api/api-parameters#order-id) — the orderId given by a placeOrder*() function | | quantity | [quantity](https://stocksdeveloper.in/documentation/api/api-parameters#quantity) | **Note on quantity:** For derivatives on Indian stock exchanges, the quantity must be a multiple of the lot size. For example, if a contract's lot size is 15, then to buy or sell 1 lot you enter 15 quantity. ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes This call sends the modify order quantity request to AutoTrader Web, which passes it on to your broker. It returns `true` when the change is confirmed, otherwise `false`. See also [Modify Order Price](https://stocksdeveloper.in/documentation/api/modify-order-price/) and [Square-off Position](https://stocksdeveloper.in/documentation/api/square-off-position/). ============================================================================== PAGE 14 OF 27 — Place Advanced Order URL: https://stocksdeveloper.in/documentation/api/place-advanced-order/ Last updated: 2026-08-08 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/placeAdvancedOrder Returns: an order id Summary: The Place Advanced Order call places any kind of order on a mapped trading account. Use it when you need to set attributes that other order functions keep at their defaults, such as validity and disclosed quantity. It works across AmiBroker, MetaTrader, Java, C#, Python, Excel and HTTP, on leading Indian stock brokers. On success it returns an order id; on failure it returns an error message. ============================================================================== This call places an advanced order. It is most useful when you want to pass attributes that are normally kept at their default values, for example [validity](https://stocksdeveloper.in/documentation/api/api-parameters#validity) and [disclosed quantity](https://stocksdeveloper.in/documentation/api/api-parameters#disclosed-quantity). For simpler cases, see [Place Regular Order](https://stocksdeveloper.in/documentation/api/place-regular-order/) and [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/). The [variety](https://stocksdeveloper.in/documentation/api/api-parameters#variety) parameter also accepts **`AT_BO`** and **`AT_CO`**, our own [bracket and cover orders](https://stocksdeveloper.in/documentation/bracket-cover-orders/), which work on every broker we support. Pass the levels in `target`, `stoploss` and `trailingStoploss` as distances in rupees from your entry price, and `productType=INTRADAY`. If you prefer a call with only the fields that apply, use [Place AutoTrader Bracket Order](https://stocksdeveloper.in/documentation/api/place-autotrader-bracket-order/) or [Place AutoTrader Cover Order](https://stocksdeveloper.in/documentation/api/place-autotrader-cover-order/) instead. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/placeAdvancedOrder \ -H "api-key: " \ -d "variety=REGULAR" \ -d "pseudoAccount=ACC_NICK_NAME" \ -d "exchange=" \ -d "symbol=SBIN" \ -d "tradeType=SELL" \ -d "orderType=MARKET" \ -d "productType=INTRADAY" \ -d "quantity=1" \ -d "price=0" \ -d "triggerPrice=0" \ -d "amo=false" \ -d "validity=DAY" ``` ### Response ```json { "result":"200622000325378", "error":null, "message":null, "status":true, "commandId":"dea02c25-4c10-4a78-81dc-8da1e42ff0eb" } ``` The response fields work as follows: | Field | Meaning | | --- | --- | | `result` | The order id given by your trading platform. | | `status` | `true` on success. On error, it is `false` and `message` holds the error text. | | `commandId` | Used to trace the activity on AutoTrader Web. | ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. ## Parameters | Parameter | Description | |---|---| | variety | [variety](https://stocksdeveloper.in/documentation/api/api-parameters#variety) — `REGULAR`, `BO`, `CO`, `AT_BO` or `AT_CO` | | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | exchange | instrument (stock/derivative) [exchange](https://stocksdeveloper.in/documentation/api/api-parameters#exchange) | | symbol | instrument (stock/derivative) [symbol](https://stocksdeveloper.in/documentation/api/api-parameters#symbol) | | tradeType | [trade type](https://stocksdeveloper.in/documentation/api/api-parameters#trade-type) | | orderType | [order type](https://stocksdeveloper.in/documentation/api/api-parameters#order-type) | | productType | [product type](https://stocksdeveloper.in/documentation/api/api-parameters#product-type) | | quantity | [quantity](https://stocksdeveloper.in/documentation/api/api-parameters#quantity) | | price | order [price](https://stocksdeveloper.in/documentation/api/api-parameters#price) | | triggerPrice | [trigger price](https://stocksdeveloper.in/documentation/api/api-parameters#trigger-price) | | target | [target](https://stocksdeveloper.in/documentation/api/api-parameters#target) for a bracket order (`BO` or `AT_BO`) | | stoploss | [stoploss](https://stocksdeveloper.in/documentation/api/api-parameters#stoploss) for a bracket order (`BO`, `AT_BO` or `AT_CO`) | | trailingStoploss | [trailing stoploss](https://stocksdeveloper.in/documentation/api/api-parameters#trailing-stoploss) step for a bracket order (`BO`, `AT_BO` or `AT_CO`) | | disclosedQuantity | [disclosed quantity](https://stocksdeveloper.in/documentation/api/api-parameters#disclosed-quantity) | | validity | [validity](https://stocksdeveloper.in/documentation/api/api-parameters#validity) | | amo | [After Market Order](https://stocksdeveloper.in/documentation/api/api-parameters#amo) | | strategyId | strategy id (kept for future use). Keep it -1 for now | | comments | any comments you might want to add to the order | | validate | [validate](https://stocksdeveloper.in/documentation/api/api-parameters#validate) order (check for duplicate signals). Only applicable for AmiBroker. | **Note on quantity:** For derivatives on Indian stock exchanges, quantity should be a multiple of the lot size. For example, if a contract's lot size is 15, then to buy or sell 1 lot you enter 15 quantity. ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes Once the order is placed, you can track it with [Read Orders](https://stocksdeveloper.in/documentation/api/read-orders/), change it with [Modify Order](https://stocksdeveloper.in/documentation/api/modify-order/), or stop it with [Cancel Order](https://stocksdeveloper.in/documentation/api/cancel-order/). For related order types, see [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/). ============================================================================== PAGE 15 OF 27 — Place AutoTrader Bracket Order URL: https://stocksdeveloper.in/documentation/api/place-autotrader-bracket-order/ Last updated: 2026-08-08 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/placeAutoTraderBracketOrder Returns: an order id Summary: The Place AutoTrader Bracket Order call places our own bracket order — an ordinary intraday entry with a target, a stoploss and an optional trailing stoploss attached, watched by AutoTrader Web. Unlike Place Bracket Order, which uses your broker's bracket order and works only where your broker offers one, this works on every broker we support. It is available in Python, Java, C# and the HTTP REST API. On success it returns an order id; on failure it returns an error message. ============================================================================== This call places an **AutoTrader bracket order** (`AT_BO`). Your entry goes to your broker as an ordinary intraday order, and AutoTrader Web watches the price and closes the position when your target or stoploss is reached — so it works on **every broker we support**, including brokers that do not offer bracket orders of their own. This is a different call from [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/), which uses **your broker's** bracket order and is unchanged. Nothing you already run changes behaviour. **Target, stoploss and trailing stoploss are distances in rupees from your entry price, not prices** — the same as they are for [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/). On a buy filled at 180.50, `target=5` closes at 185.50 and `stoploss=2.5` closes at 178.00. The `trailingStoploss` is the **step** the stop moves in each time the price advances by that much, so it needs a `stoploss` alongside it to say how far behind the price the stop sits; sending it alone is rejected. See [Bracket & Cover Orders](https://stocksdeveloper.in/documentation/bracket-cover-orders/) for the full explanation and an interactive example. Three things this call does **not** do: it does not give you the extra intraday margin some brokers give on their own bracket orders, it is intraday only and squares itself off before the market closes, and your levels are watched by AutoTrader Web rather than resting at the exchange. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/placeAutoTraderBracketOrder \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" \ -d "exchange=" \ -d "symbol=SBIN" \ -d "tradeType=BUY" \ -d "orderType=LIMIT" \ -d "quantity=10" \ -d "price=180.5" \ -d "triggerPrice=0" \ -d "target=5" \ -d "stoploss=2.5" \ -d "trailingStoploss=1" ``` ### Response ```json { "result":"200622000335719", "error":null, "message":null, "status":true, "commandId":"9b87532c-cade-49d3-8ace-76db7be63029" } ``` The response fields work as follows: | Field | Meaning | | --- | --- | | `result` | The order id given by your trading platform, for the entry order. | | `status` | `true` on success. On error, it is `false` and `message` holds the error text. | | `commandId` | Used to trace the activity on AutoTrader Web. | ## Parameters | Parameter | Description | |---|---| | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | exchange | instrument (stock/derivative) [exchange](https://stocksdeveloper.in/documentation/api/api-parameters#exchange) | | symbol | instrument (stock/derivative) [symbol](https://stocksdeveloper.in/documentation/api/api-parameters#symbol) | | tradeType | [trade type](https://stocksdeveloper.in/documentation/api/api-parameters#trade-type) | | orderType | [order type](https://stocksdeveloper.in/documentation/api/api-parameters#order-type) | | quantity | [quantity](https://stocksdeveloper.in/documentation/api/api-parameters#quantity) | | price | order [price](https://stocksdeveloper.in/documentation/api/api-parameters#price) | | triggerPrice | [trigger price](https://stocksdeveloper.in/documentation/api/api-parameters#trigger-price) for the **entry** order, when your entry is a stoploss order. Pass zero otherwise. | | target | [target](https://stocksdeveloper.in/documentation/api/api-parameters#target), in rupees away from your entry price. Required. | | stoploss | [stoploss](https://stocksdeveloper.in/documentation/api/api-parameters#stoploss), in rupees away from your entry price. Required. | | trailingStoploss | [trailing stoploss](https://stocksdeveloper.in/documentation/api/api-parameters#trailing-stoploss) step, in rupees. Pass zero for a stop that does not move. | There is no `productType` parameter: an AutoTrader bracket order is always intraday. **Note on quantity:** For derivatives on Indian stock exchanges, quantity should be a multiple of the lot size. For example, if a contract's lot size is 15, then to buy or sell 1 lot you enter 15 quantity. This call **cannot be split** across the exchange's maximum quantity for a single order — send a quantity within the limit, or place several separate orders. ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes - **You must agree to the terms once**, before your first AutoTrader bracket or cover order. Until you do, this call is rejected with a message telling you so; open AutoTrader Web, pick `AT_BO` in the order window and follow the one-time opt-in. - **One at a time per symbol.** A second AutoTrader bracket on the same account and symbol is rejected while the first is running. - **To change the target or stoploss after placing**, use AutoTrader Web — open the Positions tab and click the `AT_BO` tag on the row. There are no API functions for this yet; tell us if you need them. - **To close the position now**, use [Square Off Position](https://stocksdeveloper.in/documentation/api/square-off-position/). The bracket ends with the position. - **To cancel an entry that has not filled**, use [Cancel Order](https://stocksdeveloper.in/documentation/api/cancel-order/). The bracket ends with the entry order. - **[Cancel Child Orders](https://stocksdeveloper.in/documentation/api/cancel-child-orders/) does nothing** for an AutoTrader bracket order — there are no broker child orders to cancel, because the target and stoploss are not resting at the exchange. - Your order book shows the entry as an ordinary order. Nothing in the order book marks it as a bracket; the Positions tab in AutoTrader Web is where you see it. - **Needs a recent library version.** These calls were added in **Python 1.4.0**, **Java 3.2.0** and **C# 1.4.0**. If your editor does not offer the function, upgrade the library — see [client setup](https://stocksdeveloper.in/documentation/client-setup/). The HTTP REST call needs nothing installed. - **Not yet available in Excel, AmiBroker or MetaTrader.** Use [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/) there, or the HTTP REST call above. For related order types, see [Place AutoTrader Cover Order](https://stocksdeveloper.in/documentation/api/place-autotrader-cover-order/), [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/) and [Place Advanced Order](https://stocksdeveloper.in/documentation/api/place-advanced-order/). ============================================================================== PAGE 16 OF 27 — Place AutoTrader Cover Order URL: https://stocksdeveloper.in/documentation/api/place-autotrader-cover-order/ Last updated: 2026-08-08 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/placeAutoTraderCoverOrder Returns: an order id Summary: The Place AutoTrader Cover Order call places our own cover order — an ordinary intraday entry with a stoploss, and no target, watched by AutoTrader Web. Unlike Place Cover Order, which uses your broker's cover order and works only where your broker offers one, this works on every broker we support. Note the difference in how the stop is given: a broker cover order takes an absolute stop price in triggerPrice, while this call takes a distance in rupees from your entry price in stoploss. It is available in Python, Java, C# and the HTTP REST API. ============================================================================== This call places an **AutoTrader cover order** (`AT_CO`) — a stoploss with no target. Your entry goes to your broker as an ordinary intraday order, and AutoTrader Web watches the price and closes the position when your stoploss is reached, so it works on **every broker we support**. This is a different call from [Place Cover Order](https://stocksdeveloper.in/documentation/api/place-cover-order/), which uses **your broker's** cover order and is unchanged. ### ⚠️ The stop is given differently from a broker cover order This is the one thing to get right when moving across: | | Where the stop goes | What the number means | |---|---|---| | [Place Cover Order](https://stocksdeveloper.in/documentation/api/place-cover-order/) (your broker's) | `triggerPrice` | The **stop price** itself — e.g. `178` | | Place AutoTrader Cover Order | `stoploss` | **Rupees away from your entry price** — e.g. `2.5` | There is no `triggerPrice` parameter on this call at all. On a buy filled at 180.50, `stoploss=2.5` closes the position at 178.00. You can also pass a `trailingStoploss`: the **step** the stop moves in each time the price advances by that much. It needs the `stoploss` alongside it to say how far behind the price the stop sits. See [Bracket & Cover Orders](https://stocksdeveloper.in/documentation/bracket-cover-orders/) for the full explanation and an interactive example. Three things this call does **not** do: it does not give you the extra intraday margin some brokers give on their own cover orders, it is intraday only and squares itself off before the market closes, and your stoploss is watched by AutoTrader Web rather than resting at the exchange. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/placeAutoTraderCoverOrder \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" \ -d "exchange=" \ -d "symbol=SBIN" \ -d "tradeType=BUY" \ -d "orderType=LIMIT" \ -d "quantity=10" \ -d "price=180.5" \ -d "stoploss=2.5" \ -d "trailingStoploss=1" ``` ### Response ```json { "result":"200622000335719", "error":null, "message":null, "status":true, "commandId":"9b87532c-cade-49d3-8ace-76db7be63029" } ``` The response fields work as follows: | Field | Meaning | | --- | --- | | `result` | The order id given by your trading platform, for the entry order. | | `status` | `true` on success. On error, it is `false` and `message` holds the error text. | | `commandId` | Used to trace the activity on AutoTrader Web. | ## Parameters | Parameter | Description | |---|---| | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | exchange | instrument (stock/derivative) [exchange](https://stocksdeveloper.in/documentation/api/api-parameters#exchange) | | symbol | instrument (stock/derivative) [symbol](https://stocksdeveloper.in/documentation/api/api-parameters#symbol) | | tradeType | [trade type](https://stocksdeveloper.in/documentation/api/api-parameters#trade-type) | | orderType | [order type](https://stocksdeveloper.in/documentation/api/api-parameters#order-type) — `LIMIT` or `MARKET` | | quantity | [quantity](https://stocksdeveloper.in/documentation/api/api-parameters#quantity) | | price | order [price](https://stocksdeveloper.in/documentation/api/api-parameters#price) | | stoploss | [stoploss](https://stocksdeveloper.in/documentation/api/api-parameters#stoploss), in rupees away from your entry price. Required. | | trailingStoploss | [trailing stoploss](https://stocksdeveloper.in/documentation/api/api-parameters#trailing-stoploss) step, in rupees. Pass zero for a stop that does not move. | There is no `triggerPrice` and no `target` on this call. A cover order has no target — use [Place AutoTrader Bracket Order](https://stocksdeveloper.in/documentation/api/place-autotrader-bracket-order/) if you want one. There is no `productType` either: an AutoTrader cover order is always intraday. **Note on quantity:** For derivatives on Indian stock exchanges, quantity should be a multiple of the lot size. This call **cannot be split** across the exchange's maximum quantity for a single order — send a quantity within the limit, or place several separate orders. ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes - **You must agree to the terms once**, before your first AutoTrader bracket or cover order. Until you do, this call is rejected with a message telling you so. - **One at a time per symbol.** A second AutoTrader bracket or cover order on the same account and symbol is rejected while the first is running. - **To change the stoploss after placing**, use AutoTrader Web — open the Positions tab and click the `AT_CO` tag on the row. There are no API functions for this yet. - **To close the position now**, use [Square Off Position](https://stocksdeveloper.in/documentation/api/square-off-position/); to cancel an entry that has not filled, use [Cancel Order](https://stocksdeveloper.in/documentation/api/cancel-order/). The cover order ends with either. - **Needs a recent library version.** These calls were added in **Python 1.4.0**, **Java 3.2.0** and **C# 1.4.0**. If your editor does not offer the function, upgrade the library — see [client setup](https://stocksdeveloper.in/documentation/client-setup/). The HTTP REST call needs nothing installed. - **Not yet available in Excel, AmiBroker or MetaTrader.** Use [Place Cover Order](https://stocksdeveloper.in/documentation/api/place-cover-order/) there, or the HTTP REST call above. For related order types, see [Place AutoTrader Bracket Order](https://stocksdeveloper.in/documentation/api/place-autotrader-bracket-order/), [Place Cover Order](https://stocksdeveloper.in/documentation/api/place-cover-order/) and [Place Advanced Order](https://stocksdeveloper.in/documentation/api/place-advanced-order/). ============================================================================== PAGE 17 OF 27 — Place Bracket Order URL: https://stocksdeveloper.in/documentation/api/place-bracket-order/ Last updated: 2026-08-08 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/placeBracketOrder Returns: an order id Summary: The Place Bracket Order call places a bracket order with a target, a stoploss and a trailing stoploss in one call. The same function is available in AmiBroker, MetaTrader, Excel, Java, C#, Python and HTTP REST. On success it returns an order id; on failure it returns an error message. Your broker must support bracket orders on our platform. ============================================================================== This call places a bracket order using **your broker's own** bracket order, so it works only on brokers that offer one. If your broker does not, or its bracket orders are unreliable, use [Place AutoTrader Bracket Order](https://stocksdeveloper.in/documentation/api/place-autotrader-bracket-order/) instead — that one works on every broker we support, takes the same three level values, and adds a trailing stop everywhere. **Target, stoploss and trailing stoploss are distances from your entry price, not prices.** In the examples below, an order at 180.50 with `target=5` and `stoploss=2.5` gives a target of 185.50 and a stop of 178.00. Passing 185.5 as the target would ask for a target 185.50 away from your entry, which is almost certainly not what you want. See [API Parameters](https://stocksdeveloper.in/documentation/api/api-parameters/) for the full explanation. The simplest way to check is to place a small sample bracket order and see if it goes through; if you get an error, your broker may not support it — [contact support](https://stocksdeveloper.in/contact/) or [suggest it as a feature request](https://stocksdeveloper.in/built-with-traders/) and we will look into it. For related order types, see [Place Cover Order](https://stocksdeveloper.in/documentation/api/place-cover-order/) and [Place Advanced Order](https://stocksdeveloper.in/documentation/api/place-advanced-order/). ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/placeBracketOrder \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" \ -d "exchange=" \ -d "symbol=SBIN" \ -d "tradeType=BUY" \ -d "orderType=LIMIT" \ -d "quantity=10" \ -d "price=180.5" \ -d "triggerPrice=0" \ -d "target=5" \ -d "stoploss=2.5" \ -d "trailingStoploss=1" ``` ### Response ```json { "result":"200622000335719", "error":null, "message":null, "status":true, "commandId":"9b87532c-cade-49d3-8ace-76db7be63029" } ``` The response fields work as follows: | Field | Meaning | | --- | --- | | `result` | The order id given by your trading platform. | | `status` | `true` on success. On error, it is `false` and `message` holds the error text. | | `commandId` | Used to trace the activity on AutoTrader Web. | ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. ## Parameters | Parameter | Description | |---|---| | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | exchange | instrument (stock/derivative) [exchange](https://stocksdeveloper.in/documentation/api/api-parameters#exchange) | | symbol | instrument (stock/derivative) [symbol](https://stocksdeveloper.in/documentation/api/api-parameters#symbol) | | tradeType | [trade type](https://stocksdeveloper.in/documentation/api/api-parameters#trade-type) | | orderType | [order type](https://stocksdeveloper.in/documentation/api/api-parameters#order-type) | | quantity | [quantity](https://stocksdeveloper.in/documentation/api/api-parameters#quantity) | | price | order [price](https://stocksdeveloper.in/documentation/api/api-parameters#price) | | triggerPrice | [trigger price](https://stocksdeveloper.in/documentation/api/api-parameters#trigger-price) | | target | [target](https://stocksdeveloper.in/documentation/api/api-parameters#target) for bracket order | | stoploss | [stoploss](https://stocksdeveloper.in/documentation/api/api-parameters#stoploss) for bracket order | | trailingStoploss | [trailing stoploss](https://stocksdeveloper.in/documentation/api/api-parameters#trailing-stoploss) for bracket order | | validate | [validate](https://stocksdeveloper.in/documentation/api/api-parameters#validate) order (check for duplicate signals). Only applicable for AmiBroker and MetaTrader. | **Note on quantity:** For derivatives on Indian stock exchanges, quantity should be a multiple of the lot size. For example, if a contract's lot size is 15, then to buy or sell 1 lot you enter 15 quantity. ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes Your broker must support bracket orders on our platform. Try placing a bracket order from our platform's trading terminal first to confirm whether it is supported. For related order types, see [Place Cover Order](https://stocksdeveloper.in/documentation/api/place-cover-order/), [Place Advanced Order](https://stocksdeveloper.in/documentation/api/place-advanced-order/), and [Place Regular Order](https://stocksdeveloper.in/documentation/api/place-regular-order/). ============================================================================== PAGE 18 OF 27 — Place Cover Order URL: https://stocksdeveloper.in/documentation/api/place-cover-order/ Last updated: 2026-08-08 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/placeCoverOrder Returns: an order id Summary: The Place Cover Order call places a cover order across leading Indian stock brokers. The same function is available in AmiBroker, MetaTrader, Excel, Java, C#, Python and the HTTP REST API. On success it returns an order id; on failure it returns an error message. Confirm your broker supports cover orders before using it. ============================================================================== A cover order is a market or limit order paired with a compulsory stop-loss trigger price. Use this call to place one from any supported client using **your broker's own** cover order, so it works only on brokers that offer one. If your broker does not, use [Place AutoTrader Cover Order](https://stocksdeveloper.in/documentation/api/place-autotrader-cover-order/) instead — that one works on every broker we support and can also trail the stop. Note that it takes the stop as a **distance in rupees** from your entry price, not as a trigger price. The simplest way to check is to place a small sample cover order and see if it goes through; if you get an error, your broker may not support it — [contact support](https://stocksdeveloper.in/contact/) or [suggest it as a feature request](https://stocksdeveloper.in/built-with-traders/) and we will look into it. For related order types, see [Place Regular Order](https://stocksdeveloper.in/documentation/api/place-regular-order/) and [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/). ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/placeCoverOrder \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" \ -d "exchange=" \ -d "symbol=SBIN" \ -d "tradeType=BUY" \ -d "orderType=LIMIT" \ -d "quantity=10" \ -d "price=180.5" \ -d "triggerPrice=180" ``` ### Response ```json { "result":"200622000333410", "error":null, "message":null, "status":true, "commandId":"6d4b5738-c1aa-4623-b0c5-8df779e0f44d" } ``` The response fields work as follows: | Field | Meaning | | --- | --- | | `result` | The order id given by your trading platform. | | `status` | `true` on success. On error, it is `false` and `message` holds the error text. | | `commandId` | Used to trace the activity on AutoTrader Web. | ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. ## Parameters | Parameter | Description | | --- | --- | | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | exchange | instrument (stock/derivative) [exchange](https://stocksdeveloper.in/documentation/api/api-parameters#exchange) | | symbol | instrument (stock/derivative) [symbol](https://stocksdeveloper.in/documentation/api/api-parameters#symbol) | | tradeType | [trade type](https://stocksdeveloper.in/documentation/api/api-parameters#trade-type) | | orderType | [order type](https://stocksdeveloper.in/documentation/api/api-parameters#order-type) | | quantity | [quantity](https://stocksdeveloper.in/documentation/api/api-parameters#quantity) | | price | order [price](https://stocksdeveloper.in/documentation/api/api-parameters#price) | | triggerPrice | [trigger price](https://stocksdeveloper.in/documentation/api/api-parameters#trigger-price) | | validate | [validate](https://stocksdeveloper.in/documentation/api/api-parameters#validate) order (check for duplicate signals). Only applicable for AmiBroker and MetaTrader. | **Note on quantity:** For derivatives on Indian stock exchanges, quantity should be a multiple of the lot size. For example, if a contract's lot size is 15, then to buy or sell 1 lot you enter 15 quantity. ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes Your broker must support cover orders on our platform. Try placing a cover order from our platform's trading terminal first to confirm whether it is supported. For related order types, see [Place Regular Order](https://stocksdeveloper.in/documentation/api/place-regular-order/) and [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/). ============================================================================== PAGE 19 OF 27 — Place Regular Order URL: https://stocksdeveloper.in/documentation/api/place-regular-order/ Last updated: 2026-07-27 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/placeRegularOrder Returns: an order id Summary: The Place Regular Order call places a single regular order into the trading account mapped to a pseudo account. The same call works across every client language and every supported broker. On success it returns an order id; on failure it returns an error message. ============================================================================== This call places a regular order. It is available in HTTP REST, Python, Java, C#, Excel, AmiBroker, and MetaTrader. For other order styles, see [Place Cover Order](https://stocksdeveloper.in/documentation/api/place-cover-order/), [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/), and [Place Advanced Order](https://stocksdeveloper.in/documentation/api/place-advanced-order/). ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/placeRegularOrder \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" \ -d "exchange=" \ -d "symbol=BANKNIFTY_25-JUN-2020_FUT" \ -d "tradeType=BUY" \ -d "orderType=MARKET" \ -d "productType=INTRADAY" \ -d "quantity=20" \ -d "price=0" \ -d "triggerPrice=0" ``` ### Response ```json { "result":"200622000325378", "error":null, "message":null, "status":true, "commandId":"dea02c25-4c10-4a78-81dc-8da1e42ff0eb" } ``` The response fields work as follows: | Field | Meaning | | --- | --- | | `result` | The order id given by your trading platform. | | `status` | `true` on success. On error, it is `false` and `message` holds the error text. | | `commandId` | Used to trace the activity on AutoTrader Web. | ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. ## Parameters | Parameter | Description | | --- | --- | | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | exchange | instrument (stock/derivative) [exchange](https://stocksdeveloper.in/documentation/api/api-parameters#exchange) | | symbol | instrument (stock/derivative) [symbol](https://stocksdeveloper.in/documentation/api/api-parameters#symbol) | | tradeType | [trade type](https://stocksdeveloper.in/documentation/api/api-parameters#trade-type) | | orderType | [order type](https://stocksdeveloper.in/documentation/api/api-parameters#order-type) | | productType | [product type](https://stocksdeveloper.in/documentation/api/api-parameters#product-type) | | quantity | [quantity](https://stocksdeveloper.in/documentation/api/api-parameters#quantity) | | price | order [price](https://stocksdeveloper.in/documentation/api/api-parameters#price) | | triggerPrice | [trigger price](https://stocksdeveloper.in/documentation/api/api-parameters#trigger-price) | | validate | [validate](https://stocksdeveloper.in/documentation/api/api-parameters#validate) order (check for duplicate signals). Only applicable for AmiBroker & MetaTrader. | **Note on quantity:** For derivatives on Indian stock exchanges, quantity should be a multiple of the lot size. For example, if a contract's lot size is 15, then to buy or sell 1 lot you enter 15 quantity. ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes Once the order is placed, you can track it with [Read Orders](https://stocksdeveloper.in/documentation/api/read-orders/), change it with [Modify Order](https://stocksdeveloper.in/documentation/api/modify-order/), or stop it with [Cancel Order](https://stocksdeveloper.in/documentation/api/cancel-order/). ============================================================================== PAGE 20 OF 27 — Read Holdings URL: https://stocksdeveloper.in/documentation/api/read-holdings/ Last updated: 2026-07-27 HTTP method: GET HTTP endpoint: https://apix.stocksdeveloper.in/trading/readPlatformHoldings Returns: your holdings Summary: Read Holdings returns the live holdings for the trading account mapped to a pseudo account. The same call works across every client language and supported broker. Each holding includes quantity, average price, P&L, ISIN and collateral details. Cache the result and reuse it to stay within the rate limits. ============================================================================== This call reads holdings from your trading platform. It returns data for the trading account linked to the [pseudo account](https://stocksdeveloper.in/documentation/broker-independence/pseudo-account/) you pass in. The same call is available across all [supported brokers](https://stocksdeveloper.in/documentation/supported-brokers/), so your code stays broker independent. See [API functions](https://stocksdeveloper.in/documentation/broker-independence/api-functions/) for the full list. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/readPlatformHoldings \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" ``` The response is JSON, in the format shown under [Response](https://stocksdeveloper.in/documentation/api/read-holdings/#response). Each holding carries the [Holding fields](https://stocksdeveloper.in/documentation/api/read-holdings/#fields) listed below. ## Response The call returns an array of holdings in JSON. ```json { "result":[ { "isin":"INE075A01022", "collateralType":"--", "instrumentToken":"3787", "product":"CNC", "quantity":0, "collateralQty":0, "t1Qty":1, "pnl":null, "haircut":0.0, "avgPrice":0.0, "pseudoAccount":"ACC_NICK_NAME", "tradingAccount":"XX9999", "stockBroker":"YOUR_BROKER", "exchange":"", "symbol":"WIPRO-EQ", "platform":"PLATFORM", "day":[2021,2,24] } ], "message":null, "status":true, "commandId":"2335425e-da65-462b-a898-6c139833bb9b" } ``` `status` is `true` on success. On error it is `false`, and `message` holds the error text. ## Holding fields Each holding carries the fields below. They are the same across every language: the libraries expose them as object properties (Python, Java, C#) or as a `getHolding` function (Excel, AmiBroker, MetaTrader), and the HTTP response returns them as JSON keys. | Field | Type | Description | | --- | --- | --- | | `pseudoAccount` | string | The account nickname (pseudo account) the holding belongs to. | | `tradingAccount` | string | The mapped trading account id. | | `stockBroker` | string | The stock broker for this account. | | `exchange` | string | Broker specific exchange. | | `symbol` | string | Broker specific symbol. | | `isin` | string | ISIN of the instrument. | | `instrumentToken` | string | Broker instrument token. | | `product` | string | Product type for the holding. | | `quantity` | int | Total holding quantity. | | `t1Qty` | int | T1 quantity (not yet settled). | | `collateralType` | string | Collateral type, if pledged. | | `collateralQty` | int | Quantity pledged as collateral. | | `haircut` | float | Collateral haircut. | | `avgPrice` | float | Average buy price. | | `ltp` | float | Last traded price. | | `currentValue` | float | Current market value of the holding. | | `pnl` | float | Net returns on the holding. | | `day` | date | Holding date. | | `platform` | enum | Trading platform the holding belongs to. | ## Notes It is recommended to download and cache holdings periodically, then look up the cached set, to avoid hitting the [API rate limits](https://stocksdeveloper.in/documentation/api/api-rate-limits/). P&L data is not available from certain brokers (see [limitations](https://stocksdeveloper.in/documentation/precautions/)). In those cases, the values you see are calculated by our system. If you notice any issue, please let us know. ============================================================================== PAGE 21 OF 27 — Read Margins URL: https://stocksdeveloper.in/documentation/api/read-margins/ Last updated: 2026-07-27 HTTP method: GET HTTP endpoint: https://apix.stocksdeveloper.in/trading/readPlatformMargins Returns: your margins Summary: Read Margins returns the live margin details for the trading account mapped to a pseudo account. The same call works across every client language and supported broker. Margins are grouped into equity, commodity and all, each with values such as funds, utilized, available, net, span, exposure and MTM. Cache the result and reuse it to stay within the rate limits. ============================================================================== This call reads margins from your trading platform. It returns data for the trading account linked to the [pseudo account](https://stocksdeveloper.in/documentation/broker-independence/pseudo-account/) you pass in. Margins are grouped into three categories: `equity`, `commodity` and `all` (the entire account). The same call is available across all [supported brokers](https://stocksdeveloper.in/documentation/supported-brokers/), so your code stays broker independent. See [API functions](https://stocksdeveloper.in/documentation/broker-independence/api-functions/) for the full list. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/readPlatformMargins \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" ``` The response is JSON, in the format shown under [Response](https://stocksdeveloper.in/documentation/api/read-margins/#response). Each margin carries the [Margin fields](https://stocksdeveloper.in/documentation/api/read-margins/#fields) listed below. ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. ## Response The call returns an array of margins in JSON, one record per category, sourced from your trading platform. ```json { "result":[ { "category":"ALL", "funds":944.16, "utilized":0.05, "available":944.11, "day":[2020,7,2], "pseudoAccount":"ACC_NICK_NAME", "tradingAccount":"XX9999", "stockBroker":"YOUR_BROKER" }, { "category":"EQUITY", "funds":944.16, "utilized":0.05, "available":944.11, "day":[2020,7,2], "pseudoAccount":"ACC_NICK_NAME", "tradingAccount":"XX9999", "stockBroker":"YOUR_BROKER" } ], "message":null, "status":true, "commandId":"e7f67fa1-d696-4aed-bd3c-dd6f44e526ef" } ``` `status` is `true` on success. On error it is `false`, and `message` holds the error text. ## Margin fields Each margin carries the fields below. They are the same across every language: object properties (Python/Java/C#) or a `getMargin` function (Excel/AmiBroker/MetaTrader), and JSON keys over HTTP. | Field | Type | Description | | --- | --- | --- | | `pseudoAccount` | string | The account nickname (pseudo account) the margin belongs to. | | `tradingAccount` | string | The mapped trading account id. | | `stockBroker` | string | The stock broker for this account. | | `category` | enum | Margin category (EQUITY, COMMODITY, ALL). | | `funds` | float | Total funds. | | `utilized` | float | Utilized margin. | | `available` | float | Available margin. | | `total` | float | Total margin. | | `net` | float | Net margin. | | `span` | float | Span margin. | | `exposure` | float | Exposure margin. | | `collateral` | float | Collateral margin. | | `payin` | float | Payin amount. | | `payout` | float | Payout amount. | | `adhoc` | float | Adhoc margin. | | `realisedMtm` | float | Realised mark to market. | | `unrealisedMtm` | float | Unrealised mark to market. | | `day` | date | Margin date. | ## Notes It is recommended to download and cache margins periodically, then look up the cached set, to avoid hitting the [API rate limits](https://stocksdeveloper.in/documentation/api/api-rate-limits/). Not every field is available from every broker (see [limitations](https://stocksdeveloper.in/documentation/precautions/)). In those cases the value may be empty or zero. If you notice any issue, please let us know. ============================================================================== PAGE 22 OF 27 — Read Orders URL: https://stocksdeveloper.in/documentation/api/read-orders/ Last updated: 2026-07-27 HTTP method: GET HTTP endpoint: https://apix.stocksdeveloper.in/trading/readPlatformOrders Returns: your orders Summary: Read Orders returns the live orders for the trading account mapped to a pseudo account. The same call works across every client language and supported broker. Each order includes status, quantity, price, trade type and timestamps. Cache the result and reuse it to stay within the rate limits. ============================================================================== This call reads orders from your trading platform. It returns data for the trading account linked to the [pseudo account](https://stocksdeveloper.in/documentation/broker-independence/pseudo-account/) you pass in. The same call is available across all [supported brokers](https://stocksdeveloper.in/documentation/supported-brokers/), so your code stays broker independent. See [API functions](https://stocksdeveloper.in/documentation/broker-independence/api-functions/) for the full list. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/readPlatformOrders \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" ``` The response is JSON, in the format shown under [Response](https://stocksdeveloper.in/documentation/api/read-orders/#response). Each order carries the [Order fields](https://stocksdeveloper.in/documentation/api/read-orders/#fields) listed below. ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) page to learn how to use it. ## Response The call returns an array of orders in JSON, sourced from your trading platform. ```json { "result":[ { "id":"200702202385337", "tradeType":"SELL", "orderType":"MARKET", "productType":"INTRADAY", "variety":"REGULAR", "validity":"DAY", "quantity":1, "disclosedQuantity":0, "price":0.0, "triggerPrice":0.0, "comments":"01XbtQwPsUSTYGA", "modifiedTime":1593710627248, "createdTime":1593710627248, "amo":false, "statusMessage":null, "pseudoAccount":"ACC_NICK_NAME", "tradingAccount":"XX9999", "stockBroker":"YOUR_BROKER", "exchange":"", "symbol":"SBIN", "independentExchange":"", "independentSymbol":"SBIN", "day":[2020,7,2], "parentOrderId":null, "exchangeOrderId":"1300000009330856", "averagePrice":185.35, "clientId":"XX9999", "rawStatus":"COMPLETE", "platformTime":1593682696000, "exchangeTime":1593682696000, "pendingQuantity":0, "filledQuantity":1, "platform":"PLATFORM", "status":"COMPLETE" } ], "message":null, "status":true, "commandId":"e5a02067-278b-4c5e-bcae-660252c13df3" } ``` `status` is `true` on success. On error it is `false`, and `message` holds the error text. ## Order fields Each order carries the fields below. They are the same across every language: object properties (Python/Java/C#) or a `getOrder` function (Excel/AmiBroker/MetaTrader), and JSON keys over HTTP. | Field | Type | Description | | --- | --- | --- | | `pseudoAccount` | string | The account nickname (pseudo account) the order belongs to. | | `tradingAccount` | string | The mapped trading account id. | | `stockBroker` | string | The stock broker for this account. | | `id` | string | Order id given by your trading platform. | | `exchange` | string | Broker specific exchange. | | `symbol` | string | Broker specific symbol. | | `independentExchange` | string | Broker independent exchange. | | `independentSymbol` | string | Broker independent symbol. | | `tradeType` | enum | Trade type (BUY, SELL). | | `orderType` | enum | Order type (LIMIT, MARKET, STOP_LOSS, SL_MARKET). | | `productType` | enum | Product type (INTRADAY, DELIVERY, NORMAL, MTF). | | `variety` | enum | Order variety (REGULAR, BO, CO). | | `validity` | enum | Order validity (DAY, IOC). | | `quantity` | int | Order quantity. | | `disclosedQuantity` | int | Disclosed quantity. | | `filledQuantity` | int | Filled quantity. | | `pendingQuantity` | int | Pending quantity. | | `price` | float | Order price entered while placing the order. | | `triggerPrice` | float | Trigger price. | | `averagePrice` | float | Average price at which the order traded. | | `status` | enum | Broker independent status (OPEN, COMPLETE, CANCELLED, REJECTED, TRIGGER_PENDING, UNKNOWN). | | `rawStatus` | string | Status as returned by your broker. | | `statusMessage` | string | Status message or rejection reason. | | `amo` | enum | After market order flag (true/false). | | `comments` | string | Order comments. | | `parentOrderId` | string | Parent bracket or cover order id, for child orders. | | `exchangeOrderId` | string | Exchange order id. | | `clientId` | string | Client (account) id as returned by your broker. | | `platformTime` | date | Order timestamp given by the trading platform. | | `exchangeTime` | date | Order timestamp given by the exchange. | | `createdTime` | date | Created time. | | `modifiedTime` | date | Modified time. | | `day` | date | Order date. | | `platform` | enum | Trading platform the order belongs to. | | `publisherId` | string | Publisher id given by AmiBroker, MetaTrader, Excel etc. | ## Notes It is recommended to download and cache orders periodically, then look up the cached set, to avoid hitting the [API rate limits](https://stocksdeveloper.in/documentation/api/api-rate-limits/). Some fields may be empty depending on the order state and the broker (see [limitations](https://stocksdeveloper.in/documentation/precautions/)). If you notice any issue, please let us know. ============================================================================== PAGE 23 OF 27 — Read Positions URL: https://stocksdeveloper.in/documentation/api/read-positions/ Last updated: 2026-07-27 HTTP method: GET HTTP endpoint: https://apix.stocksdeveloper.in/trading/readPlatformPositions Returns: live positions Summary: Read Positions returns the live positions for the trading account mapped to a pseudo account. The same call works across every client language and supported broker. Each position includes quantities, values, average prices and P&L. Cache the result and reuse it to stay within the rate limits. ============================================================================== This call reads positions from your trading platform. It returns data for the trading account linked to the [pseudo account](https://stocksdeveloper.in/documentation/broker-independence/pseudo-account/) you pass in. The same call is available across all [supported brokers](https://stocksdeveloper.in/documentation/supported-brokers/), so your code stays broker independent. See [API functions](https://stocksdeveloper.in/documentation/broker-independence/api-functions/) for the full list. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/readPlatformPositions \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" ``` The response is JSON, in the format shown under [Response](https://stocksdeveloper.in/documentation/api/read-positions/#response). Each position carries the [Position fields](https://stocksdeveloper.in/documentation/api/read-positions/#fields) listed below. ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. ## Response The call returns an array of positions in JSON. Some platforms return two sets per instrument — a `DAY` set and a `NET` set. ```json { "result":[ { "buyQuantity":1, "sellQuantity":1, "netQuantity":0, "type":"MIS", "pnl":0.0, "atPnl":0.0, "mtm":0.0, "buyValue":185.35, "sellValue":185.35, "netValue":0.0, "buyAvgPrice":185.35, "sellAvgPrice":185.35, "day":[2020,7,2], "pseudoAccount":"ACC_NICK_NAME", "tradingAccount":"XX9999", "stockBroker":"YOUR_BROKER", "exchange":"", "symbol":"SBIN", "independentExchange":"", "independentSymbol":"SBIN", "category":"DAY", "ltp":185.45, "platform":"PLATFORM", "accountId":"XX9999", "overnightQuantity":0, "multiplier":1, "realisedPnl":0.0, "unrealisedPnl":0.0 }, { "buyQuantity":1, "sellQuantity":1, "netQuantity":0, "type":"MIS", "pnl":-0.05, "atPnl":-0.05, "mtm":-0.05, "buyValue":225.05, "sellValue":225.0, "netValue":-0.05, "buyAvgPrice":225.05, "sellAvgPrice":225.0, "day":[2020,7,2], "pseudoAccount":"ACC_NICK_NAME", "tradingAccount":"XX9999", "stockBroker":"YOUR_BROKER", "exchange":"", "symbol":"WIPRO", "independentExchange":"", "independentSymbol":"WIPRO", "category":"NET", "ltp":224.2, "platform":"PLATFORM", "accountId":"XX9999", "overnightQuantity":0, "multiplier":1, "realisedPnl":0.0, "unrealisedPnl":-0.05 } ], "message":null, "status":true, "commandId":"099c75ff-6987-4d8a-b42b-5627338a94ae" } ``` `status` is `true` on success. On error it is `false`, and `message` holds the error text. ## Position fields Each position carries the fields below. They are the same across every language: the libraries expose them as object properties (Python, Java, C#) or as a `getPosition` function (Excel, AmiBroker, MetaTrader), and the HTTP response returns them as JSON keys. | Field | Type | Description | | --- | --- | --- | | `pseudoAccount` | string | The account nickname (pseudo account) the position belongs to. | | `tradingAccount` | string | The mapped trading account id. | | `stockBroker` | string | The stock broker for this account. | | `exchange` | string | Broker specific exchange. | | `symbol` | string | Broker specific symbol. | | `independentExchange` | string | Broker independent exchange. | | `independentSymbol` | string | Broker independent symbol. | | `buyQuantity` | int | Total bought quantity. | | `sellQuantity` | int | Total sold quantity. | | `netQuantity` | int | Net quantity (buy minus sell). | | `type` | enum | Product type (MIS, NRML, CNC, BO, CO). | | `direction` | enum | Position direction (LONG, SHORT, NEUTRAL). | | `category` | string | Position set: `DAY` or `NET`. Some brokers send `NET` only — see [precautions](https://stocksdeveloper.in/documentation/precautions/). | | `pnl` | float | Net returns, as reported by your broker. | | `atPnl` | float | P&L calculated by AutoTrader Web. | | `mtm` | float | Mark to market returns. | | `realisedPnl` | float | Realised intraday returns. | | `unrealisedPnl` | float | Unrealised intraday returns. | | `buyValue` | float | Total value of bought quantity. | | `sellValue` | float | Total value of sold quantity. | | `netValue` | float | Net value. | | `buyAvgPrice` | float | Average price of bought quantity. | | `sellAvgPrice` | float | Average price of sold quantity. | | `ltp` | float | Last traded price. | | `overnightQuantity` | int | Quantity carried forward overnight. | | `multiplier` | float | Quantity multiplier used for P&L. Usually 1. Some commodity contracts use a different value, and it can be a fraction such as 0.1. | | `day` | date | Position date. | | `platform` | enum | Trading platform the position belongs to. | ## Notes It is recommended to download and cache positions periodically, then look up the cached set, to avoid hitting the [API rate limits](https://stocksdeveloper.in/documentation/api/api-rate-limits/). M2M and P&L data is not available from certain brokers (see [limitations](https://stocksdeveloper.in/documentation/precautions/)). In those cases, the values you see are calculated by our system. If you notice any issue, please let us know. ### Reading the multiplier The `multiplier` tells you how much one unit of quantity is worth when a price moves. P&L for a position works out to `quantity × multiplier × price difference`. For shares and their derivatives the multiplier is `1`. Some commodity contracts use a different value, because the price is quoted for a different unit than the one the quantity is counted in. That value is not always a whole number — it can be a fraction such as `0.1`. Read this field as a decimal number, not a whole number. If your code stores it in an integer variable, a value like `0.1` will be rounded to `0` and your own P&L calculation will be wrong. Whole values are still sent without a decimal point, so `1` stays `1`. ============================================================================== PAGE 24 OF 27 — Square-off Portfolio URL: https://stocksdeveloper.in/documentation/api/square-off-portfolio/ Last updated: 2026-09-07 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/squareOffPortfolio Returns: true on success Summary: The Square-off Portfolio call exits all OPEN positions in a single trading account. The system finds every OPEN position in the account and sends a square-off request for each one. You can also cancel all open orders first by passing `cancelOpenOrders`. It works the same way across AmiBroker, MetaTrader, Excel, Java, C#, Python and HTTP REST, and returns true on success. ============================================================================== Use this call when you want to exit all open positions in an account at once. For example, an intraday trader may want to square off the full portfolio before the broker's auto-square-off time. This call works with leading Indian stock brokers; see the full list on the [supported brokers](https://stocksdeveloper.in/documentation/supported-brokers/) page. To exit a single position instead of the whole account, use [Square-off Position](https://stocksdeveloper.in/documentation/api/square-off-position/). This call cancels all open orders for the account before it starts the square-off. A parameter named `cancelOpenOrders` controls this behaviour. Every open order is cancelled, not just one. GTT orders are not included, because a GTT rests with your broker. Cancel those separately if you need to. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/squareOffPortfolio \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" \ -d "category=NET" \ -d "cancelOpenOrders=true" ``` ### Response ```json { "result":true, "error":null, "message":null, "status":true, "commandId":"9f8b5738-c1aa-4623-b0c5-8df779e0f44d" } ``` ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. ## Parameters | Parameter | Description | | --- | --- | | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | category | [position category](https://stocksdeveloper.in/documentation/api/api-parameters#position-category) | ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes To exit a single position instead, use [Square-off Position](https://stocksdeveloper.in/documentation/api/square-off-position/). To check order status, use [Read Orders](https://stocksdeveloper.in/documentation/api/read-orders/). ============================================================================== PAGE 25 OF 27 — Square-off Position URL: https://stocksdeveloper.in/documentation/api/square-off-position/ Last updated: 2026-07-27 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/trading/squareOffPosition Returns: true on success Summary: The Square-off Position call closes one open position for an account. It first checks that the position is OPEN, then places the square-off. It works for all position types (MIS, NRML, CNC, BO, CO). The same function is available in AmiBroker, MetaTrader, Excel, Java, C#, Python and HTTP REST, and returns true on success. Set `cancelOpenOrders=true` to cancel any open orders for that position before square-off. ============================================================================== This call closes a single open position. The system validates that the position is OPEN, then proceeds with the square-off. It can square off all position types: MIS, NRML, CNC, BO and CO. It works across leading Indian stock brokers. In most cases you should square off a position with a reverse order. Use this call for special cases where you want to close a position but do not want to enter a new position for the same symbol. It can also cancel any open orders for the given position before starting square-off, via the `cancelOpenOrders` parameter. ## HTTP ### Example ```shell curl https://apix.stocksdeveloper.in/trading/squareOffPosition \ -H "api-key: " \ -d "pseudoAccount=ACC_NICK_NAME" \ -d "category=NET" \ -d "type=MIS" \ -d "exchange=" \ -d "symbol=SBIN" \ -d "cancelOpenOrders=true" ``` ### Response ```json { "result":true, "error":null, "message":null, "status":true, "commandId":"6d4b5738-c1aa-1543-b0c5-8df779e0f44d" } ``` ## Postman Postman is a widely used tool for API testing. We provide a collection of all our APIs in Postman collection format. See the [Postman collection](https://stocksdeveloper.in/documentation/api/postman/) guide to learn how to use it. ## Parameters | Parameter | Description | | --- | --- | | account | nickname of the broker account (also known as [pseudo account](https://stocksdeveloper.in/documentation/api/api-parameters#account)) | | category | [position category](https://stocksdeveloper.in/documentation/api/api-parameters#position-category) | | type | [position type](https://stocksdeveloper.in/documentation/api/api-parameters#position-type) | | exchange | instrument (stock/derivative) [exchange](https://stocksdeveloper.in/documentation/api/api-parameters#exchange) | | symbol | instrument (stock/derivative) [symbol](https://stocksdeveloper.in/documentation/api/api-parameters#symbol) | For broker-independent exchange and symbol values, see [instruments and symbols](https://stocksdeveloper.in/documentation/broker-independence/instruments-symbols/). ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes It is important to understand how AutoTrader Web's square-off works. The full details are on the [Square-off process](https://stocksdeveloper.in/autotrader-web-square-off-process/) page. This feature is fairly stable, but it might not work in rare scenarios. There are many combinations to test across Indian stock exchanges, brokers and position types (MIS, NRML, CNC, BO, CO), and testing all of them in a live market is hard with the time and resources we have. To stay safe, this feature has a fail-safe built in. It stops further executions after the first failure. This protects clients. Consider this scenario: - The client's strategy sends a square-off request. - AutoTrader places a square-off order. - The square-off fails (most likely a multiplier issue, as some brokers return net quantity that is not in multiples of lot size). - The client's strategy sees the position is still open, so it sends the square-off request again. - But AutoTrader will not place another square-off order. Doing so would create a loop, with one square-off order for every function call by the client's strategy. The result of such a loop could be **disastrous**. So we added a check that stops square-off execution for a position after the first failure. We watch all failures and make changes to the system as needed. To exit the whole account instead, use [Square-off Portfolio](https://stocksdeveloper.in/documentation/api/square-off-portfolio/). ============================================================================== PAGE 26 OF 27 — Validate Trading Account Credentials URL: https://stocksdeveloper.in/documentation/api/validate-trading-account-credentials/ Last updated: 2026-08-08 HTTP method: POST HTTP endpoint: https://apix.stocksdeveloper.in/account/validateCredentials Returns: true on success Summary: These calls check whether a trading account's login credentials are valid. AutoTrader Web tries to log in to the broker's trading platform and reports back success or failure. Run them every morning before the market opens to find accounts with wrong or expired credentials. There are three functions: validate before adding an account, validate one existing account, or validate all your live accounts at once. ============================================================================== This call checks whether a trading account's login credentials are valid. AutoTrader Web tries to log in to the broker's trading platform and reports back success or failure. It is useful every morning before the market starts, so you can find accounts with incorrect or expired credentials early. It is available over the HTTP REST API and is mainly for developers building custom apps on our [broker independent trading APIs](https://stocksdeveloper.in/documentation/broker-independence/api-functions/). There are three functions: | Function | When to use it | | --- | --- | | Validate Credentials | Validate credentials before adding an account in the system. | | Validate Account | Validate credentials of a single trading account already in the system. | | Validate All Accounts | Validate credentials of all accounts under your user. | Validate All Accounts only checks **LIVE** accounts. ## HTTP ### Example Validate credentials before adding an account: ```shell curl https://apix.stocksdeveloper.in/account/validateCredentials \ -H "api-key: " \ -d "broker=YOUR_BROKER" \ -d "platform=PLATFORM" \ -d "loginId=" \ -d "password=" \ -d "totpKey=" ``` Validate a single existing account (by trading account id): ```shell curl https://apix.stocksdeveloper.in/account/validateAccount \ -H "api-key: " \ -d "tradingAccId=" ``` Validate all your live accounts: ```shell curl https://apix.stocksdeveloper.in/account/validateAllAccounts \ -H "api-key: " ``` ### Response Validate Credentials and Validate Account return the same structure. On success: ```json { "result": true, "message": null, "status": true, "commandId": "d26a6efb-0690-4fc2-bba1-04fda58db03e" } ``` On failure: ```json { "result": false, "message": "Error from broker: [10002 - Incorrect Client ID or Password. Attempt 1 of 5]", "status": true, "commandId": "cc577516-0de1-4e1e-bc61-0b8007db1722" } ``` Validate All Accounts returns a list, one entry per account: ```json { "result": [ { "tradingAccId": 23409730, "pseudoAccId": 23409731, "valid": true, "result": "SUCCESS", "message": "SUCCESS", "tradingAccLoginId": "NM291" }, { "tradingAccId": 23502007, "pseudoAccId": 23502008, "valid": false, "result": "FAILURE", "message": "Error from broker: [Access denied]", "tradingAccLoginId": "159401" } ], "message": null, "status": true, "commandId": null } ``` ## Parameters ### Validate Credentials The parameters are the same as the [Create Trading Account parameters](https://stocksdeveloper.in/documentation/api/create-or-update-trading-account/). ### Validate Account | Parameter | Type | Description | | --- | --- | --- | | `tradingAccId` | Number (Long) | Unique trading account id generated by AutoTrader Web. Get it from the [Fetch All Trading Accounts API](https://stocksdeveloper.in/documentation/api/fetch-all-trading-accounts/). | ### Validate All Accounts No parameters. The response fields for Validate Credentials and Validate Account are `result` (`SUCCESS` or `FAILURE`) and `message` (success or error message). For Validate All Accounts, each item in the `result` list carries `result` (`SUCCESS` or `FAILURE`), `message` (failure reason), `valid` (boolean), `tradingAccLoginId`, `tradingAccId` (internal id) and `pseudoAccId` (internal id). ## Return value The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel. ## Notes These calls are not meant to be made repeatedly, so they have stricter limits than the other APIs. See [API rate limits](https://stocksdeveloper.in/documentation/api/api-rate-limits/) for the full list. ## Notes - **Needs a recent library version.** These calls are available in **Python 1.5.0**, **Java 3.3.0** and **C# 1.5.0** or newer. If your editor does not offer the function, upgrade the library — see [client setup](https://stocksdeveloper.in/documentation/client-setup/). The HTTP REST calls need nothing installed. - **Not available in Excel, AmiBroker or MetaTrader.** Use the HTTP REST calls there. - Validating logs in to the broker, so run it before the session starts rather than in a loop during market hours. ============================================================================== PAGE 27 OF 27 — HTTP REST URL: https://stocksdeveloper.in/documentation/client-setup/http-rest-api/ Last updated: 2026-09-06 Summary: The HTTP REST API lets you automate trading from any programming language. Every language library we provide is just a wrapper over this same API, so if your language is not covered you can call the endpoints directly. The one thing you must get right is passing your API key in the request header. ============================================================================== ## What it is The HTTP REST API is the foundation of AutoTrader Web. It is broker independent, so the same requests work across every supported broker on Indian stock exchanges. Every language library we provide (Python, Java, C#) is a thin wrapper over these same endpoints. It is the right choice when you build in a language we do not ship a library for. Almost every modern language can make HTTP requests, so you can automate from any of them. ## How it connects HTTP REST is a **direct** client. Your code calls AutoTrader Web over a secure web connection, and AutoTrader Web passes each instruction on to your broker. Nothing extra needs to run on your computer. Every client reaches the platform the same way, so there is nothing to install on your machine. ## Before you begin Have these ready first: - **A way to make HTTP requests** from your language or tool. - **An AutoTrader Web account.** Your requests run through it. - **An API key.** Generate it in your account settings, then keep it private. - **At least one broker account added**, so your orders have somewhere to go. ## Authenticate There is no SDK to install. You call the endpoints directly. The one thing you must get right is authentication: pass your API key in the HTTP header on every request. You can find your API key on AutoTrader Web. See the [API key settings guide](https://stocksdeveloper.in/documentation/user-interface/settings/security/) for the steps. ## Make a request Each endpoint, with full request and response samples in several languages, is documented in the [API reference](https://stocksdeveloper.in/documentation/api/). Look for the HTTP examples on each function page. Start with [place a regular order](https://stocksdeveloper.in/documentation/api/place-regular-order/) and the [API parameters](https://stocksdeveloper.in/documentation/api/api-parameters/) guide for what to pass.