API Basics

This page covers the fundamental conventions that apply to every endpoint in the Tradejini Rest API.


Base URL

All API requests must be sent to:

https://api.tradejini.com/v2

Endpoint paths in this documentation are shown relative to this base URL. For example, GET /api/oms/orders means:

GET https://api.tradejini.com/v2/api/oms/orders

Authentication

All protected endpoints require an Authorization header in the following format:

Authorization: Bearer <api_key>:<access_token>
PartDescription
<api_key>Your app's alphanumeric API key from the Apps section
<access_token>The token returned by the authentication endpoint. Valid for 24 hours.

The Individual Token endpoint (POST /api-gw/oauth/individual-token-v2) uses a different format — it only requires the API key, since it is the endpoint that generates the access token:

Authorization: Bearer <api_key>

See the Authorization Flow section for step-by-step instructions.


Request Format

HTTP MethodContent-TypeBody format
GETQuery parameters only
DELETEQuery parameters only
POSTapplication/x-www-form-urlencodedForm-encoded key=value pairs
PUTapplication/x-www-form-urlencodedForm-encoded key=value pairs

Example POST request:

curl -X POST https://api.tradejini.com/v2/api/oms/place-order \
  -H "Authorization: Bearer xK9mP2qRtZ:eyJhbGciOiJSUzI1NiJ9..." \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "symId=EQT_RELIANCE_EQ_NSE&qty=10&side=buy&type=limit&product=delivery&limitPrice=2440&validity=day"

Response Format

All JSON responses follow a consistent envelope structure:

{
  "s": "ok",
  "d": { ... }
}
FieldTypeValuesDescription
sstring"ok", "error", "no-data"Response status
danyobject, array, or stringResponse payload. Present only when s is "ok".
msgstringPresent on "error" and "no-data" responses instead of d.

Success response (object payload):

{ "s": "ok", "d": { "orderId": "210115000000001", "msg": "Order Placed Successfully" } }

Success response (array payload):

{ "s": "ok", "d": [ { "symId": "EQT_RELIANCE_EQ_NSE", "qty": 10 } ] }

No-data response:

{ "s": "no-data", "msg": "no-data" }

Error response:

{ "s": "error", "msg": "Input validation failed. Kindly check your input contains required fields for the request" }

Symbol IDs

Instruments are identified by a symId string. The format encodes the asset class, symbol, series, and exchange:

EQT_RELIANCE_EQ_NSE      → Reliance Industries equity on NSE
FUT_NIFTY_FUT_NFO_25APR2024  → NIFTY April 2024 futures
OPT_NIFTY_CE_NFO_25APR2024_22000  → NIFTY April 2024 22000 CE options

Use the Scrip Master Data endpoint to look up valid symId values.


Order Field Codes

Many order fields use abbreviated codes. The full value set is accepted in requests and returned in responses.

FieldAccepted valuesMeaning
sidebuy, sellOrder direction
typelimit, market, stoplimit, stopmarketOrder price type
productdelivery, intraday, normal, cover, bracketProduct / margin type
validityday, ioc, eos, gtcOrder validity — Day, Immediate-or-Cancel, End-of-Session (BSE only), Good-Till-Cancelled
statusopen, completed, rejected, cancelledOrder status in order book
legTypemain, stoploss, targetLeg type for bracket/cover orders

Static IP Requirement

For Individual App registrations, all API requests must originate from a whitelisted static IP address. This is enforced at the gateway level. Requests from non-whitelisted IPs return 401 Unauthorized with no further detail.

Ensure you have a static IP from your ISP, a cloud provider (AWS/GCP/Azure), or a VPS before going live. You register the IP during App Creation.


Pagination

The Tradejini Rest API does not use cursor-based or offset pagination. All list endpoints return the full result set for the authenticated user's session in a single response.

On this page