Skip to content
Cirrus home
Sign in

Reference

Baskets

Saved sets of orders you can place together later.

List your baskets #

GET /v1/baskets scope read

The caller's saved baskets, most recently updated first.

Errors

HTTPCodeWhen
401unauthorized

No credential, or the credential is invalid, expired or revoked.

403forbidden

The credential may not use this route (missing scope, app-session-only route, IP not allowed).

429rate_limited

Too many requests for this credential (or too many failed attempts); retry after the Retry-After header (seconds; error.retry_after_ms has the exact wait).

503service_unavailable

A dependency is temporarily unavailable, or the feature is off on this server; retry later.

All fields (request and response schema)

Loading fields…

GET
curl "https://cirrus.pocketful.in/v1/baskets" \
  -H "Authorization: token $CIRRUS_API_KEY"
Response · 200
{
  "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 #

POST /v1/baskets scope orders

Saves 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 strategy on POST /v1/orders): at most 64 letters, digits, _, ., : or -.

Errors

HTTPCodeWhen
400malformed_json

The body is not JSON, or does not fit the request shape (unknown or missing fields, wrong types).

400invalid_idempotency_key

The Idempotency-Key header is not 1-128 printable characters.

401unauthorized

No credential, or the credential is invalid, expired or revoked.

403forbidden

The credential may not use this route (missing scope, app-session-only route, IP not allowed).

409request_in_progress

A request with this Idempotency-Key is still being processed.

422invalid_request

The request is well-formed but not valid; field names the input.

422idempotency_key_reused

This Idempotency-Key was already used with a different request.

429rate_limited

Too many requests for this credential (or too many failed attempts); retry after the Retry-After header (seconds; error.retry_after_ms has the exact wait).

503service_unavailable

A dependency is temporarily unavailable, or the feature is off on this server; retry later.

All fields (request and response schema)

Loading fields…

POST
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"
    }
  }'
Response · 201
{
  "status": "success",
  "data": {
    "id": "bk_01m4xdf6chg4r9pswvwqp3y9cq"
  },
  "error": null
}

Read a basket #

GET /v1/baskets/{basket_id} scope read

Read a basket

Parameters

  • basket_id path · string required

    Basket id (bk_...).

Errors

HTTPCodeWhen
401unauthorized

No credential, or the credential is invalid, expired or revoked.

403forbidden

The credential may not use this route (missing scope, app-session-only route, IP not allowed).

404basket_not_found

No saved basket with this id for the caller.

429rate_limited

Too many requests for this credential (or too many failed attempts); retry after the Retry-After header (seconds; error.retry_after_ms has the exact wait).

503service_unavailable

A dependency is temporarily unavailable, or the feature is off on this server; retry later.

All fields (request and response schema)

Loading fields…

GET
curl "https://cirrus.pocketful.in/v1/baskets/<basket_id>" \
  -H "Authorization: token $CIRRUS_API_KEY"
Response · 200
{
  "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 #

PUT /v1/baskets/{basket_id} scope orders

Replaces 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 strategy on POST /v1/orders): at most 64 letters, digits, _, ., : or -.

Errors

HTTPCodeWhen
400malformed_json

The body is not JSON, or does not fit the request shape (unknown or missing fields, wrong types).

400invalid_idempotency_key

The Idempotency-Key header is not 1-128 printable characters.

401unauthorized

No credential, or the credential is invalid, expired or revoked.

403forbidden

The credential may not use this route (missing scope, app-session-only route, IP not allowed).

404basket_not_found

No saved basket with this id for the caller.

409request_in_progress

A request with this Idempotency-Key is still being processed.

422invalid_request

The request is well-formed but not valid; field names the input.

422idempotency_key_reused

This Idempotency-Key was already used with a different request.

429rate_limited

Too many requests for this credential (or too many failed attempts); retry after the Retry-After header (seconds; error.retry_after_ms has the exact wait).

503service_unavailable

A dependency is temporarily unavailable, or the feature is off on this server; retry later.

All fields (request and response schema)

Loading fields…

PUT
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"
    }
  }'
Response · 200
{
  "status": "success",
  "data": {
    "id": "bk_01m4xdf6cg7098z58t00emzhr3"
  },
  "error": null
}

Delete a basket #

DELETE /v1/baskets/{basket_id} scope orders

Delete 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

HTTPCodeWhen
400invalid_idempotency_key

The Idempotency-Key header is not 1-128 printable characters.

401unauthorized

No credential, or the credential is invalid, expired or revoked.

403forbidden

The credential may not use this route (missing scope, app-session-only route, IP not allowed).

404basket_not_found

No saved basket with this id for the caller.

409request_in_progress

A request with this Idempotency-Key is still being processed.

422idempotency_key_reused

This Idempotency-Key was already used with a different request.

429rate_limited

Too many requests for this credential (or too many failed attempts); retry after the Retry-After header (seconds; error.retry_after_ms has the exact wait).

503service_unavailable

A dependency is temporarily unavailable, or the feature is off on this server; retry later.

DELETE
curl -X DELETE "https://cirrus.pocketful.in/v1/baskets/<basket_id>" \
  -H "Authorization: token $CIRRUS_API_KEY"

Response: 204, no body.