Baskets
Saved sets of orders you can place together later.
List your baskets #
/v1/baskets scope readThe caller's saved baskets, most recently updated first.
Errors
| HTTP | Code | When |
|---|---|---|
| 401 | unauthorized | No credential, or the credential is invalid, expired or revoked. |
| 403 | forbidden | The credential may not use this route (missing scope, app-session-only route, IP not allowed). |
| 429 | rate_limited | Too many requests for this credential (or too many failed attempts); retry after the |
| 503 | service_unavailable | A dependency is temporarily unavailable, or the feature is off on this server; retry later. |
All fields (request and response schema)
Loading fields…
curl "https://cirrus.pocketful.in/v1/baskets" \
-H "Authorization: token $CIRRUS_API_KEY"import os
import requests
response = requests.get(
"https://cirrus.pocketful.in/v1/baskets",
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/baskets', {
method: 'GET',
headers: {
Authorization: `token ${process.env.CIRRUS_API_KEY}`,
},
});
const body = await response.json();
console.log(response.status, body);{
"status": "success",
"data": [
{
"id": "bk_01m4xdf6cg5vt9yk1nmy8nemn9",
"name": "Bear call",
"leg_count": 2,
"updated_at": "2026-10-14T14:36:10.512Z"
}
],
"error": null
}Save a basket #
/v1/baskets scope ordersSaves a named basket of 1-20 legs.
More about this
At most 50 baskets per user.
Parameters
- Idempotency-Key header · string
Optional: a new UUID per request (1-128 printable characters). A repeat with the same key gets the first answer back instead of acting again.
Body fields
- name string required
Display name, 1-60 characters after trimming.
- legs object[] required
Legs, 1-20.
- prefs any
Free-form client preferences, at most 2048 serialized bytes.
- strategy string | null
Strategy to place this basket's orders under (send it as each order's
strategyonPOST /v1/orders): at most 64 letters, digits,_,.,:or-.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | malformed_json | The body is not JSON, or does not fit the request shape (unknown or missing fields, wrong types). |
| 400 | invalid_idempotency_key | The |
| 401 | unauthorized | No credential, or the credential is invalid, expired or revoked. |
| 403 | forbidden | The credential may not use this route (missing scope, app-session-only route, IP not allowed). |
| 409 | request_in_progress | A request with this |
| 422 | invalid_request | The request is well-formed but not valid; |
| 422 | idempotency_key_reused | This |
| 429 | rate_limited | Too many requests for this credential (or too many failed attempts); retry after the |
| 503 | service_unavailable | A dependency is temporarily unavailable, or the feature is off on this server; retry later. |
All fields (request and response schema)
Loading fields…
curl -X POST "https://cirrus.pocketful.in/v1/baskets" \
-H "Authorization: token $CIRRUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Bear call",
"legs": [
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22500,
"side": "BUY",
"lots": 4,
"order_type": "MARKET"
},
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22400,
"side": "SELL",
"lots": 4,
"order_type": "LIMIT",
"price": 112.5
}
],
"prefs": {
"mode": "auto",
"timeout_ms": 5000,
"partial": "filled_qty"
}
}'import os
import requests
response = requests.post(
"https://cirrus.pocketful.in/v1/baskets",
headers={
"Authorization": f"token {os.environ['CIRRUS_API_KEY']}",
},
json={
"name": "Bear call",
"legs": [
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22500,
"side": "BUY",
"lots": 4,
"order_type": "MARKET",
},
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22400,
"side": "SELL",
"lots": 4,
"order_type": "LIMIT",
"price": 112.5,
},
],
"prefs": {
"mode": "auto",
"timeout_ms": 5000,
"partial": "filled_qty",
},
},
timeout=10,
)
print(response.status_code, response.json())const response = await fetch('https://cirrus.pocketful.in/v1/baskets', {
method: 'POST',
headers: {
Authorization: `token ${process.env.CIRRUS_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Bear call",
"legs": [
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22500,
"side": "BUY",
"lots": 4,
"order_type": "MARKET"
},
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22400,
"side": "SELL",
"lots": 4,
"order_type": "LIMIT",
"price": 112.5
}
],
"prefs": {
"mode": "auto",
"timeout_ms": 5000,
"partial": "filled_qty"
}
}),
});
const body = await response.json();
console.log(response.status, body);{
"status": "success",
"data": {
"id": "bk_01m4xdf6chg4r9pswvwqp3y9cq"
},
"error": null
}Read a basket #
/v1/baskets/{basket_id} scope readRead a basket
Parameters
- basket_id path · string required
Basket id (
bk_...).
Errors
| HTTP | Code | When |
|---|---|---|
| 401 | unauthorized | No credential, or the credential is invalid, expired or revoked. |
| 403 | forbidden | The credential may not use this route (missing scope, app-session-only route, IP not allowed). |
| 404 | basket_not_found | No saved basket with this id for the caller. |
| 429 | rate_limited | Too many requests for this credential (or too many failed attempts); retry after the |
| 503 | service_unavailable | A dependency is temporarily unavailable, or the feature is off on this server; retry later. |
All fields (request and response schema)
Loading fields…
curl "https://cirrus.pocketful.in/v1/baskets/<basket_id>" \
-H "Authorization: token $CIRRUS_API_KEY"import os
import requests
response = requests.get(
"https://cirrus.pocketful.in/v1/baskets/<basket_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/baskets/<basket_id>', {
method: 'GET',
headers: {
Authorization: `token ${process.env.CIRRUS_API_KEY}`,
},
});
const body = await response.json();
console.log(response.status, body);{
"status": "success",
"data": {
"id": "bk_01m4xdf6cg5vt9yk1nmy8nemn9",
"name": "Bear call",
"legs": [
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22500,
"side": "BUY",
"lots": 4,
"order_type": "MARKET",
"price": null,
"instrument_token": null
},
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22400,
"side": "SELL",
"lots": 4,
"order_type": "LIMIT",
"price": 112.5,
"instrument_token": null
}
],
"prefs": {
"mode": "auto",
"timeout_ms": 5000,
"partial": "filled_qty"
},
"updated_at": "2026-10-14T14:36:10.512Z"
},
"error": null
}Replace a basket #
/v1/baskets/{basket_id} scope ordersReplaces the name, legs and preferences of a saved basket.
Parameters
- basket_id path · string required
Basket id (
bk_...). - Idempotency-Key header · string
Optional: a new UUID per request (1-128 printable characters). A repeat with the same key gets the first answer back instead of acting again.
Body fields
- name string required
Display name, 1-60 characters after trimming.
- legs object[] required
Legs, 1-20.
- prefs any
Free-form client preferences, at most 2048 serialized bytes.
- strategy string | null
Strategy to place this basket's orders under (send it as each order's
strategyonPOST /v1/orders): at most 64 letters, digits,_,.,:or-.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | malformed_json | The body is not JSON, or does not fit the request shape (unknown or missing fields, wrong types). |
| 400 | invalid_idempotency_key | The |
| 401 | unauthorized | No credential, or the credential is invalid, expired or revoked. |
| 403 | forbidden | The credential may not use this route (missing scope, app-session-only route, IP not allowed). |
| 404 | basket_not_found | No saved basket with this id for the caller. |
| 409 | request_in_progress | A request with this |
| 422 | invalid_request | The request is well-formed but not valid; |
| 422 | idempotency_key_reused | This |
| 429 | rate_limited | Too many requests for this credential (or too many failed attempts); retry after the |
| 503 | service_unavailable | A dependency is temporarily unavailable, or the feature is off on this server; retry later. |
All fields (request and response schema)
Loading fields…
curl -X PUT "https://cirrus.pocketful.in/v1/baskets/<basket_id>" \
-H "Authorization: token $CIRRUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Bear call (weekly)",
"legs": [
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22500,
"side": "BUY",
"lots": 4,
"order_type": "MARKET"
},
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22400,
"side": "SELL",
"lots": 4,
"order_type": "LIMIT",
"price": 112.5
}
],
"prefs": {
"mode": "auto",
"timeout_ms": 5000,
"partial": "filled_qty"
}
}'import os
import requests
response = requests.put(
"https://cirrus.pocketful.in/v1/baskets/<basket_id>",
headers={
"Authorization": f"token {os.environ['CIRRUS_API_KEY']}",
},
json={
"name": "Bear call (weekly)",
"legs": [
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22500,
"side": "BUY",
"lots": 4,
"order_type": "MARKET",
},
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22400,
"side": "SELL",
"lots": 4,
"order_type": "LIMIT",
"price": 112.5,
},
],
"prefs": {
"mode": "auto",
"timeout_ms": 5000,
"partial": "filled_qty",
},
},
timeout=10,
)
print(response.status_code, response.json())const response = await fetch('https://cirrus.pocketful.in/v1/baskets/<basket_id>', {
method: 'PUT',
headers: {
Authorization: `token ${process.env.CIRRUS_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Bear call (weekly)",
"legs": [
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22500,
"side": "BUY",
"lots": 4,
"order_type": "MARKET"
},
{
"underlying": "NIFTY",
"instrument": "option",
"expiry": "2026-10-17",
"option_type": "CE",
"strike": 22400,
"side": "SELL",
"lots": 4,
"order_type": "LIMIT",
"price": 112.5
}
],
"prefs": {
"mode": "auto",
"timeout_ms": 5000,
"partial": "filled_qty"
}
}),
});
const body = await response.json();
console.log(response.status, body);{
"status": "success",
"data": {
"id": "bk_01m4xdf6cg7098z58t00emzhr3"
},
"error": null
}Delete a basket #
/v1/baskets/{basket_id} scope ordersDelete a basket
Parameters
- basket_id path · string required
Basket id (
bk_...). - Idempotency-Key header · string
Optional: a new UUID per request (1-128 printable characters). A repeat with the same key gets the first answer back instead of acting again.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_idempotency_key | The |
| 401 | unauthorized | No credential, or the credential is invalid, expired or revoked. |
| 403 | forbidden | The credential may not use this route (missing scope, app-session-only route, IP not allowed). |
| 404 | basket_not_found | No saved basket with this id for the caller. |
| 409 | request_in_progress | A request with this |
| 422 | idempotency_key_reused | This |
| 429 | rate_limited | Too many requests for this credential (or too many failed attempts); retry after the |
| 503 | service_unavailable | A dependency is temporarily unavailable, or the feature is off on this server; retry later. |
curl -X DELETE "https://cirrus.pocketful.in/v1/baskets/<basket_id>" \
-H "Authorization: token $CIRRUS_API_KEY"import os
import requests
response = requests.delete(
"https://cirrus.pocketful.in/v1/baskets/<basket_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/baskets/<basket_id>', {
method: 'DELETE',
headers: {
Authorization: `token ${process.env.CIRRUS_API_KEY}`,
},
});
const body = await response.json();
console.log(response.status, body);Response: 204, no body.