Skip to content

Support optional CreateSubaccountRequest body (exchange_index) on subaccounts.create() (spec 3.23.0) #465

Description

@TexasCoding

Summary

OpenAPI 3.23.0 added an optional request body to an endpoint the SDK already exposes:

  • Path: POST /portfolio/subaccounts (SubaccountsResource.create)
  • New schema: CreateSubaccountRequest — a single optional exchange_index field (defaults to 0).

create() currently posts json={}, which stays functionally compatible (every field is optional), so nothing breaks. But:

  1. create() cannot target a non-zero exchange shard.
  2. Its docstring/comments are now stale — e.g. kalshi/resources/subaccounts.py says "empty body (spec takes no request payload)" / "Spec defines no requestBody", which is no longer true as of 3.23.0.

Scope

  • Add a CreateSubaccountRequest model (extra="forbid", optional exchange_index).
  • Add an optional exchange_index param to create() (sync + async); build the body via the request model.
  • Fix the stale docstring/comments.
  • Register request_body_schema in METHOD_ENDPOINT_MAP + BODY_MODEL_MAP; add a test.

Provenance

Surfaced during the #463 spec-drift reconciliation (3.22.0 → 3.23.0) as an out-of-scope enhancement. Low urgency (backward-compatible).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestspec-driftUpstream OpenAPI/AsyncAPI spec changed since last sync

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions