Key points
- You authorise access on the broker's own login page; your password should never be shared with a third party.
- Many Indian broker APIs issue session tokens that expire daily and require a fresh login.
- An order acknowledgement is not a fill; orders can be rejected, partially filled or cancelled.
- Software must reconcile its own records against the broker's order book and trades.
How authorisation works
Most Indian brokers that offer APIs use a redirect-based flow similar to OAuth. The application sends you to the broker's login page, you sign in there with your credentials and any second factor, and the broker redirects back with a short-lived code. The application exchanges that code for an access token tied to your account and the permissions you granted.
- Your broker password and one-time codes are entered only on the broker's site.
- The access token is a secret; a responsible application encrypts it and never displays it.
- Revoking the app's access at the broker ends its ability to act on your account.
Daily sessions and token expiry
Several Indian broker APIs issue access tokens that expire every trading day, so the account holder must sign in again each morning before automation can work. This is a deliberate security control. Software that relies on such a broker has to detect an expired session and stop safely rather than retry blindly.
The life of an order
| State | Meaning |
|---|---|
| Submitted / acknowledged | The broker received the request; it is not yet a trade |
| Open | Accepted by the exchange and waiting in the order book |
| Partially filled | Some quantity has traded; the rest is still open |
| Filled / complete | The full quantity traded at one or more prices |
| Rejected | Refused by the broker or exchange, for example for insufficient margin or a price outside limits |
| Cancelled | Withdrawn before full execution |
An API call that returns an order identifier only proves the broker received the request. The trade prices that matter for accounting come from the broker's trade records, and a single order can fill in several pieces at different prices. Rejections are common for reasons such as margin shortfall, circuit limits, freeze quantities or invalid lot sizes.
Rate limits and failures
Broker APIs limit how many requests an application may send per second and per day. Exceeding them returns errors. Networks also fail: a request can time out after the broker has already accepted it. Retrying such a request without a unique client order identifier can create a duplicate order.
- Use a unique identifier per intended order and check the order book before retrying.
- Back off on rate-limit errors instead of retrying immediately.
- Treat unknown outcomes as unknown, and resolve them by reading the broker's records.
Reconciliation
Reconciliation compares what your software believes happened with what the broker reports: orders, trades, positions and funds. Differences arise from manual trades placed outside the software, partial fills, broker-side cancellations or missed updates. A well-designed system reads the broker's records, flags disagreements and does not overwrite trusted data with unverified values.
Broker connections on AlgoStok
AlgoStok has implemented account linking and current-day fill import for several Indian brokers, and historical fill import for some. Each connection requires a configured environment and your authorisation on the broker's site, and some brokers require a daily sign-in. Broker order placement is disabled across every integration, and some platforms are still listed as integration pending. Availability depends on the broker and the environment; check the brokers page for the current status of each one and the trading journal for how fills are recorded.
Questions to ask about any trading tool's broker connection
- Do I sign in on the broker's own page, or does the tool ask for my password? Only the first is acceptable.
- Where and how is the access token stored, and can I revoke it at the broker?
- What does the tool do when the session expires mid-day?
- Does it place orders, or only read account data? Is that stated clearly?
- How does it handle partial fills, rejections and unknown order outcomes?
- Which records does it treat as authoritative: its own, or the broker's?
Clear answers to these questions tell you more about a tool's operational quality than any performance claim. A tool that cannot explain its failure handling is unlikely to handle failures well.
Frequently asked questions
Why do I have to log in to my broker every day?
Many Indian broker APIs issue access tokens that expire daily as a security control. Applications cannot extend them on your behalf.
My order was acknowledged. Did it trade?
Not necessarily. Acknowledgement means the request was received. Check the order status and trade records for fills, partial fills or rejection.
Can AlgoStok place orders with my broker?
No. Broker order placement is disabled for every integration. Implemented connections are used for account linking and fill import where configured.