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

OrderStatus

Get the current status of a specific order by its order ID.

Endpoint URL

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

Sample API Request

{
  "apikey": "<your_app_apikey>",
  "orderid": "250828000185002",
  "strategy": "Test Strategy"
}

Sample cURL Request

curl -X POST http://127.0.0.1:5000/api/v1/orderstatus \
  -H 'Content-Type: application/json' \
  -d '{
  "apikey": "<your_app_apikey>",
  "orderid": "250828000185002",
  "strategy": "Test Strategy"
}'

Sample API Response

Request Body

Parameter
Description
Mandatory/Optional
Default Value

apikey

Your OpenAlgo API key

Mandatory

-

orderid

Order ID to query

Mandatory

-

strategy

Strategy identifier

Mandatory

-

OrderStatusSchema declares exactly these three fields and all three are required. Omitting strategy returns HTTP 400, and any additional field returns HTTP 400 as well.

Response Fields

Field
Type
Description

status

string

"success" or "error"

data

object

Order details object

Data Object Fields

Field
Type
Description

orderid

string

Order ID

symbol

string

Trading symbol

exchange

string

Exchange code

action

string

BUY or SELL

quantity

string

Order quantity

price

number

Order price (0 for MARKET orders)

trigger_price

number

Trigger price for SL orders

pricetype

string

MARKET, LIMIT, SL, SL-M

product

string

MIS, CNC, NRML

order_status

string

Current order status

average_price

number

Average execution price

timestamp

string

Order timestamp

Order Status Values

Status
Description

complete

Order fully executed

open

Order pending execution

pending

Trigger order waiting for activation

rejected

Order rejected by exchange

cancelled

Order cancelled by user

Notes

  • Use this endpoint to track order execution status

  • The response's data object is the matching entry from the order book, with average_price added. Any additional field a broker's order-book mapper emits therefore appears here too.

  • average_price is filled in from the trade book only when order_status is complete. For open, pending, rejected, and cancelled orders it is 0.0, including partially filled orders.

  • If no order matches the given orderid, the response is an error, not a success with an empty data

  • Timestamps are in IST (Indian Standard Time)


Back to: API Documentation

Last updated