Guide
Place, modify and cancel an order
Place an order in one or many broker accounts, change its price or quantity, cancel it and check its status.
Orders go straight to your broker. One request can place the same order in several accounts, each sized for that account. You need a key with the orders scope (and read to look orders up).
Place an order #
Send the instrument, side, type, product, quantity and the accounts. Find the instrument_token with instrument search. Every place request needs a new Idempotency-Key (a UUID), so a retry never places twice.
curl -X POST "https://cirrus.pocketful.in/v1/orders" \
-H "Authorization: token $CIRRUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"orders": [
{
"instrument_token": "CT:TEST:RELIANCE",
"side": "BUY",
"order_type": "LIMIT",
"product": "DELIVERY",
"quantity": 1,
"price": 2500,
"accounts": [
"P1"
]
}
]
}'import os
import uuid
import requests
response = requests.post(
"https://cirrus.pocketful.in/v1/orders",
headers={
"Authorization": f"token {os.environ['CIRRUS_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"orders": [
{
"instrument_token": "CT:TEST:RELIANCE",
"side": "BUY",
"order_type": "LIMIT",
"product": "DELIVERY",
"quantity": 1,
"price": 2500,
"accounts": [
"P1",
],
},
],
},
timeout=10,
)
print(response.status_code, response.json())const response = await fetch('https://cirrus.pocketful.in/v1/orders', {
method: 'POST',
headers: {
Authorization: `token ${process.env.CIRRUS_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"orders": [
{
"instrument_token": "CT:TEST:RELIANCE",
"side": "BUY",
"order_type": "LIMIT",
"product": "DELIVERY",
"quantity": 1,
"price": 2500,
"accounts": [
"P1"
]
}
]
}),
});
const body = await response.json();
console.log(response.status, body);{
"status": "success",
"data": {
"results": [
{
"order_index": 0,
"account": "P1",
"quantity": 1,
"status": "accepted",
"order_id": "PAPER-1",
"message": null,
"order_type": "LIMIT",
"price": 2500,
"instrument_token": "CT:TEST:RELIANCE",
"order_tag": "01M3PGPRZFZXEQM0KEC0DB653H"
}
],
"accepted": 1,
"rejected": 0,
"unknown": 0
},
"error": null
}The answer has one result per account (and per slice, when a big order is split at the exchange freeze limit). Check each status: one account can accept while another refuses, and the request still answers 200.
Modify an order #
Send the order as it should be now. The broker’s verdict is in status; quantity must stay above what has already filled.
curl -X PATCH "https://cirrus.pocketful.in/v1/orders/<order_id>" \
-H "Authorization: token $CIRRUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account": "P1",
"instrument_token": "CT:TEST:RELIANCE",
"side": "BUY",
"order_type": "SL",
"product": "MIS",
"quantity": 5,
"price": 2500,
"trigger_price": 2499
}'import os
import requests
response = requests.patch(
"https://cirrus.pocketful.in/v1/orders/<order_id>",
headers={
"Authorization": f"token {os.environ['CIRRUS_API_KEY']}",
},
json={
"account": "P1",
"instrument_token": "CT:TEST:RELIANCE",
"side": "BUY",
"order_type": "SL",
"product": "MIS",
"quantity": 5,
"price": 2500,
"trigger_price": 2499,
},
timeout=10,
)
print(response.status_code, response.json())const response = await fetch('https://cirrus.pocketful.in/v1/orders/<order_id>', {
method: 'PATCH',
headers: {
Authorization: `token ${process.env.CIRRUS_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"account": "P1",
"instrument_token": "CT:TEST:RELIANCE",
"side": "BUY",
"order_type": "SL",
"product": "MIS",
"quantity": 5,
"price": 2500,
"trigger_price": 2499
}),
});
const body = await response.json();
console.log(response.status, body);{
"status": "success",
"data": {
"account": "P1",
"order_id": "PAPER-9",
"status": "accepted",
"message": null
},
"error": null
}Cancel an order #
Name the account and the instrument in the query. The answer is 200 once the request is valid; if the broker refuses, its reason is in message.
curl -X DELETE "https://cirrus.pocketful.in/v1/orders/<order_id>?account=<account>&instrument_token=<instrument_token>" \
-H "Authorization: token $CIRRUS_API_KEY"import os
import requests
response = requests.delete(
"https://cirrus.pocketful.in/v1/orders/<order_id>",
headers={
"Authorization": f"token {os.environ['CIRRUS_API_KEY']}",
},
params={
"account": "<account>",
"instrument_token": "<instrument_token>",
},
timeout=10,
)
print(response.status_code, response.json())const response = await fetch('https://cirrus.pocketful.in/v1/orders/<order_id>?account=<account>&instrument_token=<instrument_token>', {
method: 'DELETE',
headers: {
Authorization: `token ${process.env.CIRRUS_API_KEY}`,
},
});
const body = await response.json();
console.log(response.status, body);{
"status": "success",
"data": {
"account": "P1",
"order_id": "PAPER-8",
"status": "accepted",
"message": null
},
"error": null
}Check an order #
Read one order by its id or your own client_tag. To follow every change without polling, use the live stream or webhooks.
curl "https://cirrus.pocketful.in/v1/orders/<order_id>" \
-H "Authorization: token $CIRRUS_API_KEY"import os
import requests
response = requests.get(
"https://cirrus.pocketful.in/v1/orders/<order_id>",
headers={
"Authorization": f"token {os.environ['CIRRUS_API_KEY']}",
},
timeout=10,
)
print(response.status_code, response.json())const response = await fetch('https://cirrus.pocketful.in/v1/orders/<order_id>', {
method: 'GET',
headers: {
Authorization: `token ${process.env.CIRRUS_API_KEY}`,
},
});
const body = await response.json();
console.log(response.status, body);{
"status": "success",
"data": {
"broker_tag": null,
"order_id": "250929000101",
"parent_tag": null,
"username": "user-01M3PGPRXSNM34C3C6AM1B721X",
"account": "P1",
"broker": "paper",
"tradingsymbol": "RELIANCE-EQ",
"side": "BUY",
"order_type": "LIMIT",
"product": "MIS",
"quantity": 5,
"price": 2500,
"trigger_price": null,
"state": "OPEN",
"filled_qty": 0,
"average_price": null,
"status_message": null,
"broker_updated_at": null,
"created_at": "2026-09-29T12:02:21.780809Z",
"status_history": [],
"client_tag": "strat-7:entry",
"lot_size": 1,
"exchange": "NSE",
"instrument_type": "EQUITY",
"symbol": "RELIANCE",
"expiry": "",
"strike": 0,
"option_type": "",
"ltp": 2500,
"prev_close": 2490,
"instrument_token": "CT:TEST:RELIANCE",
"order_tag": "01M3PGPRYMRRAPV8MCBEA19MS1"
},
"error": null
}Protect it as you enter #
Add a stop-loss and target to the place request and they are set up when the order fills. See Protect a position.