Skip to content

OpenBroker SDK Orders API 0.1.0

Orders API endpoints used by the OpenBroker SDK


Servers

Description URL
Production Orders API https://algotest.in/api/orders

order_manager


POST /place

Place Orders

Description

Place multiple orders (up to 10) in a single API call

Request body

{
    "orders": [
        {
            "user_tag": "string",
            "extra_tags": {},
            "instrument_id": "string",
            "symbol": "string",
            "side": "PositionType.Buy",
            "quantity": 0,
            "product_type": "ProductType.MIS",
            "order_info": null,
            "delay": null
        }
    ],
    "broker_id": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "title": "PlaceOrdersRequest",
    "additionalProperties": false,
    "required": [
        "orders",
        "broker_id"
    ],
    "properties": {
        "orders": {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/OrderRequest"
            },
            "maxItems": 10,
            "minItems": 1,
            "title": "Orders"
        },
        "broker_id": {
            "type": "string",
            "maxLength": 32,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_]+$",
            "title": "Broker Id"
        }
    }
}

Response 200 OK

[
    {
        "success": true,
        "order_id": null,
        "user_tag": "string",
        "extra_tags": {}
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/PlaceOrderResponse"
    }
}

Response 422 Unprocessable Content

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "title": "HTTPValidationError",
    "properties": {
        "detail": {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail"
        }
    }
}

PUT /modify

Modify Orders

Description

Modify multiple orders (up to 10) in a single API call

Request body

{
    "orders": [
        {
            "order_id": "b84b89b8-6832-42b4-a727-bff5308a94b6",
            "order_info": null
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "title": "ModifyOrderRequest",
    "additionalProperties": false,
    "required": [
        "orders"
    ],
    "properties": {
        "orders": {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ModifyRequest"
            },
            "maxItems": 10,
            "minItems": 1,
            "title": "Orders"
        }
    }
}

Response 200 OK

Schema of the response body
{
    "type": "object",
    "additionalProperties": {
        "$ref": "#/components/schemas/ModifyOrderResponse"
    }
}

Response 422 Unprocessable Content

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "title": "HTTPValidationError",
    "properties": {
        "detail": {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail"
        }
    }
}

POST /cancel

Cancel Orders

Description

Cancel multiple orders (up to 10) in a single API call

Request body

[
    "8a65d1e1-27f5-4ccf-8cd1-865b9adf8182"
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "array",
    "items": {
        "type": "string",
        "format": "uuid"
    },
    "uniqueItems": true,
    "title": "Order IDs"
}

Response 200 OK

Schema of the response body
{
    "type": "object",
    "additionalProperties": {
        "$ref": "#/components/schemas/CancelOrderResponse"
    }
}

Response 422 Unprocessable Content

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "title": "HTTPValidationError",
    "properties": {
        "detail": {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail"
        }
    }
}

GET /today-orders

Get Today's Orders

Description

Retrieve all orders placed for the current trading day

Response 200 OK

[
    {
        "order_id": "9dfc9092-9eb3-46bd-9f07-443a4cb4bb80",
        "created_at": "2022-04-13T15:42:05.901Z",
        "updated_at": "2022-04-13T15:42:05.901Z",
        "user_tag": "string",
        "extra_tags": {},
        "instrument_id": "string",
        "symbol": "string",
        "product_type": "ProductType.MIS",
        "side": "PositionType.Buy",
        "quantity": 0,
        "lot_size": 0,
        "order_info": null,
        "broker_id": "string",
        "user_id": "string",
        "broker_order_id": "string",
        "status": "string",
        "rejection_code": "RejectionCode.NoError",
        "rejection_reason": "string",
        "trade_time": "string",
        "filled_quantity": 0,
        "average_price": 10.12,
        "underlying": "NIFTY",
        "strike_price": 10.12,
        "instrument_type": "CASH",
        "option_type": "CE",
        "expiry": null
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/OrderUpdateResponse"
    },
    "title": "Today's Orders"
}

GET /order

Get Single Order

Description

Retrieve details of a specific order by its ID

Input parameters

Parameter In Type Default Nullable Description
order_id query string No

Response 200 OK

{
    "order_id": "1350225c-3e8e-4715-9aca-a074bf478303",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "user_tag": "string",
    "extra_tags": {},
    "instrument_id": "string",
    "symbol": "string",
    "product_type": "ProductType.MIS",
    "side": "PositionType.Buy",
    "quantity": 0,
    "lot_size": 0,
    "order_info": null,
    "broker_id": "string",
    "user_id": "string",
    "broker_order_id": "string",
    "status": "string",
    "rejection_code": "RejectionCode.NoError",
    "rejection_reason": "string",
    "trade_time": "string",
    "filled_quantity": 0,
    "average_price": 10.12,
    "underlying": "NIFTY",
    "strike_price": 10.12,
    "instrument_type": "CASH",
    "option_type": "CE",
    "expiry": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "title": "OrderUpdateResponse",
    "required": [
        "order_id",
        "created_at",
        "updated_at",
        "user_tag",
        "extra_tags",
        "instrument_id",
        "symbol",
        "product_type",
        "side",
        "quantity",
        "lot_size",
        "order_info",
        "broker_id",
        "user_id",
        "broker_order_id",
        "status",
        "rejection_code",
        "rejection_reason",
        "trade_time",
        "filled_quantity",
        "average_price",
        "underlying",
        "strike_price",
        "instrument_type",
        "option_type",
        "expiry"
    ],
    "properties": {
        "order_id": {
            "type": "string",
            "format": "uuid",
            "title": "Order Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "user_tag": {
            "type": "string",
            "title": "User Tag"
        },
        "extra_tags": {
            "type": "object",
            "title": "Extra Tags"
        },
        "instrument_id": {
            "type": "string",
            "title": "Instrument Id"
        },
        "symbol": {
            "type": "string",
            "title": "Symbol"
        },
        "product_type": {
            "$ref": "#/components/schemas/ProductType"
        },
        "side": {
            "$ref": "#/components/schemas/PositionType"
        },
        "quantity": {
            "type": "integer",
            "title": "Quantity"
        },
        "lot_size": {
            "type": "integer",
            "title": "Lot Size"
        },
        "order_info": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/MarketOrder"
                },
                {
                    "$ref": "#/components/schemas/LimitOrder"
                },
                {
                    "$ref": "#/components/schemas/StopLossOrder"
                }
            ],
            "title": "Order Info"
        },
        "broker_id": {
            "type": "string",
            "title": "Broker Id"
        },
        "user_id": {
            "type": "string",
            "title": "User Id"
        },
        "broker_order_id": {
            "type": "string",
            "title": "Broker Order Id"
        },
        "status": {
            "type": "string",
            "title": "Status"
        },
        "rejection_code": {
            "$ref": "#/components/schemas/RejectionCode"
        },
        "rejection_reason": {
            "type": "string",
            "title": "Rejection Reason"
        },
        "trade_time": {
            "type": "string",
            "title": "Trade Time"
        },
        "filled_quantity": {
            "type": "integer",
            "title": "Filled Quantity"
        },
        "average_price": {
            "type": "number",
            "title": "Average Price"
        },
        "underlying": {
            "$ref": "#/components/schemas/Underlying"
        },
        "strike_price": {
            "type": "number",
            "minimum": 0.0,
            "title": "Strike Price"
        },
        "instrument_type": {
            "$ref": "#/components/schemas/InstrumentType"
        },
        "option_type": {
            "$ref": "#/components/schemas/OptionType"
        },
        "expiry": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Expiry"
        }
    }
}

Response 422 Unprocessable Content

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "title": "HTTPValidationError",
    "properties": {
        "detail": {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail"
        }
    }
}

GET /orders-by-user-tag

Get Orders By User Tag

Description

Retrieve all orders associated with a specific user tag

Input parameters

Parameter In Type Default Nullable Description
end_ts query None No
start_ts query None No
user_tag query string No

Response 200 OK

[
    {
        "order_id": "29ff0bf8-f2b1-40e6-99a1-d98870b773b8",
        "created_at": "2022-04-13T15:42:05.901Z",
        "updated_at": "2022-04-13T15:42:05.901Z",
        "user_tag": "string",
        "extra_tags": {},
        "instrument_id": "string",
        "symbol": "string",
        "product_type": "ProductType.MIS",
        "side": "PositionType.Buy",
        "quantity": 0,
        "lot_size": 0,
        "order_info": null,
        "broker_id": "string",
        "user_id": "string",
        "broker_order_id": "string",
        "status": "string",
        "rejection_code": "RejectionCode.NoError",
        "rejection_reason": "string",
        "trade_time": "string",
        "filled_quantity": 0,
        "average_price": 10.12,
        "underlying": "NIFTY",
        "strike_price": 10.12,
        "instrument_type": "CASH",
        "option_type": "CE",
        "expiry": null
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/OrderUpdateResponse"
    },
    "title": "Orders by User Tag"
}

Response 422 Unprocessable Content

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "title": "HTTPValidationError",
    "properties": {
        "detail": {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail"
        }
    }
}

Schemas

CancelOrderResponse

Name Type
msg string
success boolean

HTTPValidationError

Name Type
detail Array<ValidationError>

InstrumentType

Type: string

LimitOrder

Name Type
order_type string
price number

MarketOrder

Name Type
order_type string
ref_price number

ModifyOrderRequest

Name Type
orders Array<ModifyRequest>

ModifyOrderResponse

Name Type
msg string
success boolean

ModifyRequest

Name Type
order_id string(uuid)
order_info

OptionType

Type: string

OrderRequest

Name Type
delay
extra_tags
instrument_id string
order_info
product_type ProductType
quantity integer
side PositionType
symbol string
user_tag string

OrderUpdateResponse

Name Type
average_price number
broker_id string
broker_order_id string
created_at string(date-time)
expiry
extra_tags
filled_quantity integer
instrument_id string
instrument_type InstrumentType
lot_size integer
option_type OptionType
order_id string(uuid)
order_info
product_type ProductType
quantity integer
rejection_code RejectionCode
rejection_reason string
side PositionType
status string
strike_price number
symbol string
trade_time string
underlying Underlying
updated_at string(date-time)
user_id string
user_tag string

PlaceOrderResponse

Name Type
extra_tags
order_id
success boolean
user_tag string

PlaceOrdersRequest

Name Type
broker_id string
orders Array<OrderRequest>

PositionType

Type: string

ProductType

Type: string

RejectionCode

Type: string

StopLossOrder

Name Type
limit_price number
order_type string
trigger_price number

Underlying

Type: string

ValidationError

Name Type
loc Array<>
msg string
type string