For the complete documentation index, see llms.txt. This page is also available as Markdown.

Placeorder

Place a new order with the broker.

Endpoint URL

Local Host   :  POST http://127.0.0.1:5000/api/v1/placeorder
Ngrok Domain :  POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/placeorder
Custom Domain:  POST https://<your-custom-domain>/api/v1/placeorder

Sample API Request (Market Order)

{
  "apikey": "<your_app_apikey>",
  "strategy": "Python",
  "symbol": "NHPC",
  "action": "BUY",
  "exchange": "NSE",
  "pricetype": "MARKET",
  "product": "MIS",
  "quantity": "1"
}

Sample cURL Request

Sample API Response

Sample API Request (Limit Order)

Sample API Response (Limit Order)

Sample API Request (Stop-Loss Order)

Request Body

Parameter
Description
Mandatory/Optional
Default Value

apikey

Your OpenAlgo API key

Mandatory

-

strategy

Strategy identifier for tracking

Mandatory

-

symbol

Trading symbol (e.g., RELIANCE, NIFTY30JAN25FUT)

Mandatory

-

action

Order action: BUY or SELL

Mandatory

-

exchange

Exchange code accepted by the shared validation constants

Mandatory

-

pricetype

Price type: MARKET, LIMIT, SL, SL-M

Optional

MARKET

product

Product type: MIS, CNC, NRML

Optional

MIS

quantity

Positive numeric order quantity

Mandatory

-

price

Order price (required for LIMIT and SL orders)

Optional

0

trigger_price

Trigger price (required for SL and SL-M orders)

Optional

0

disclosed_quantity

Disclosed quantity for iceberg orders

Optional

0

Response Fields

Field
Type
Description

status

string

"success" or "error"

orderid

string

Unique order ID from broker (on success)

message

string

Error message (on error)

mode

string

"live" or "analyze" (when analyzer mode is enabled)

Notes

  • For MARKET orders, price and trigger_price are not required

  • For LIMIT orders, price is required

  • For SL (Stop-Loss Limit) orders, both price and trigger_price are required

  • For SL-M (Stop-Loss Market) orders, only trigger_price is required

  • The symbol must be in OpenAlgo standard format:

    • Equity: RELIANCE

    • Futures: NIFTY30JAN25FUT

    • Options: NIFTY30JAN2525000CE

  • Use MIS for intraday, CNC for equity delivery, NRML for F&O overnight positions

  • Fractional quantities are accepted only when exchange is CRYPTO. Other exchanges reject fractional values during schema validation.


Back to: API Documentation

Last updated