Portfolio API Reference¶
Endpoints¶
Amend Order¶
Synchronous API Call
kalshi_py.api.portfolio.amend_order.sync(order_id: str, *, client: Union[AuthenticatedClient, Client], body: ModelAmendOrderRequest) -> Optional[ModelAmendOrderResponse]
¶
Amend Order
Endpoint for amending the max number of fillable contracts and/or price in an existing order. Max
fillable contracts is remaining_count
+ fill_count
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
body
|
ModelAmendOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelAmendOrderResponse]
|
ModelAmendOrderResponse |
Source code in kalshi_py/api/portfolio/amend_order.py
Asynchronous API Call
kalshi_py.api.portfolio.amend_order.asyncio(order_id: str, *, client: Union[AuthenticatedClient, Client], body: ModelAmendOrderRequest) -> Optional[ModelAmendOrderResponse]
async
¶
Amend Order
Endpoint for amending the max number of fillable contracts and/or price in an existing order. Max
fillable contracts is remaining_count
+ fill_count
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
body
|
ModelAmendOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelAmendOrderResponse]
|
ModelAmendOrderResponse |
Source code in kalshi_py/api/portfolio/amend_order.py
Synchronous Detailed Response
kalshi_py.api.portfolio.amend_order.sync_detailed(order_id: str, *, client: Union[AuthenticatedClient, Client], body: ModelAmendOrderRequest) -> Response[ModelAmendOrderResponse]
¶
Amend Order
Endpoint for amending the max number of fillable contracts and/or price in an existing order. Max
fillable contracts is remaining_count
+ fill_count
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
body
|
ModelAmendOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelAmendOrderResponse]
|
Response[ModelAmendOrderResponse] |
Source code in kalshi_py/api/portfolio/amend_order.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.amend_order.asyncio_detailed(order_id: str, *, client: Union[AuthenticatedClient, Client], body: ModelAmendOrderRequest) -> Response[ModelAmendOrderResponse]
async
¶
Amend Order
Endpoint for amending the max number of fillable contracts and/or price in an existing order. Max
fillable contracts is remaining_count
+ fill_count
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
body
|
ModelAmendOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelAmendOrderResponse]
|
Response[ModelAmendOrderResponse] |
Source code in kalshi_py/api/portfolio/amend_order.py
Batch Cancel Orders¶
Synchronous API Call
kalshi_py.api.portfolio.batch_cancel_orders.sync(*, client: Union[AuthenticatedClient, Client], body: ModelBatchCancelOrdersRequest) -> Optional[ModelBatchCancelOrdersResponse]
¶
Batch Cancel Orders
Endpoint for cancelling up to 20 orders at once. Available to members with advanced access only.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelBatchCancelOrdersRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelBatchCancelOrdersResponse]
|
ModelBatchCancelOrdersResponse |
Source code in kalshi_py/api/portfolio/batch_cancel_orders.py
Asynchronous API Call
kalshi_py.api.portfolio.batch_cancel_orders.asyncio(*, client: Union[AuthenticatedClient, Client], body: ModelBatchCancelOrdersRequest) -> Optional[ModelBatchCancelOrdersResponse]
async
¶
Batch Cancel Orders
Endpoint for cancelling up to 20 orders at once. Available to members with advanced access only.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelBatchCancelOrdersRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelBatchCancelOrdersResponse]
|
ModelBatchCancelOrdersResponse |
Source code in kalshi_py/api/portfolio/batch_cancel_orders.py
Synchronous Detailed Response
kalshi_py.api.portfolio.batch_cancel_orders.sync_detailed(*, client: Union[AuthenticatedClient, Client], body: ModelBatchCancelOrdersRequest) -> Response[ModelBatchCancelOrdersResponse]
¶
Batch Cancel Orders
Endpoint for cancelling up to 20 orders at once. Available to members with advanced access only.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelBatchCancelOrdersRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelBatchCancelOrdersResponse]
|
Response[ModelBatchCancelOrdersResponse] |
Source code in kalshi_py/api/portfolio/batch_cancel_orders.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.batch_cancel_orders.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], body: ModelBatchCancelOrdersRequest) -> Response[ModelBatchCancelOrdersResponse]
async
¶
Batch Cancel Orders
Endpoint for cancelling up to 20 orders at once. Available to members with advanced access only.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelBatchCancelOrdersRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelBatchCancelOrdersResponse]
|
Response[ModelBatchCancelOrdersResponse] |
Source code in kalshi_py/api/portfolio/batch_cancel_orders.py
Batch Create Orders¶
Synchronous API Call
kalshi_py.api.portfolio.batch_create_orders.sync(*, client: Union[AuthenticatedClient, Client], body: ModelBatchCreateOrdersRequest) -> Optional[ModelBatchCreateOrdersResponse]
¶
Batch Create Orders
Endpoint for submitting a batch of orders. Each order in the batch is counted against the total rate limit for order operations. Consequently, the size of the batch is capped by the current per- second rate-limit configuration applicable to the user. At the moment of writing, the limit is 20 orders per batch. Available to members with advanced access only.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelBatchCreateOrdersRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelBatchCreateOrdersResponse]
|
ModelBatchCreateOrdersResponse |
Source code in kalshi_py/api/portfolio/batch_create_orders.py
Asynchronous API Call
kalshi_py.api.portfolio.batch_create_orders.asyncio(*, client: Union[AuthenticatedClient, Client], body: ModelBatchCreateOrdersRequest) -> Optional[ModelBatchCreateOrdersResponse]
async
¶
Batch Create Orders
Endpoint for submitting a batch of orders. Each order in the batch is counted against the total rate limit for order operations. Consequently, the size of the batch is capped by the current per- second rate-limit configuration applicable to the user. At the moment of writing, the limit is 20 orders per batch. Available to members with advanced access only.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelBatchCreateOrdersRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelBatchCreateOrdersResponse]
|
ModelBatchCreateOrdersResponse |
Source code in kalshi_py/api/portfolio/batch_create_orders.py
Synchronous Detailed Response
kalshi_py.api.portfolio.batch_create_orders.sync_detailed(*, client: Union[AuthenticatedClient, Client], body: ModelBatchCreateOrdersRequest) -> Response[ModelBatchCreateOrdersResponse]
¶
Batch Create Orders
Endpoint for submitting a batch of orders. Each order in the batch is counted against the total rate limit for order operations. Consequently, the size of the batch is capped by the current per- second rate-limit configuration applicable to the user. At the moment of writing, the limit is 20 orders per batch. Available to members with advanced access only.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelBatchCreateOrdersRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelBatchCreateOrdersResponse]
|
Response[ModelBatchCreateOrdersResponse] |
Source code in kalshi_py/api/portfolio/batch_create_orders.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.batch_create_orders.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], body: ModelBatchCreateOrdersRequest) -> Response[ModelBatchCreateOrdersResponse]
async
¶
Batch Create Orders
Endpoint for submitting a batch of orders. Each order in the batch is counted against the total rate limit for order operations. Consequently, the size of the batch is capped by the current per- second rate-limit configuration applicable to the user. At the moment of writing, the limit is 20 orders per batch. Available to members with advanced access only.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelBatchCreateOrdersRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelBatchCreateOrdersResponse]
|
Response[ModelBatchCreateOrdersResponse] |
Source code in kalshi_py/api/portfolio/batch_create_orders.py
Cancel Order¶
Synchronous API Call
kalshi_py.api.portfolio.cancel_order.sync(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelCancelOrderResponse]
¶
Cancel Order
Endpoint for canceling orders. The value for the orderId should match the id field of the order you want to decrease. Commonly, DELETE-type endpoints return 204 status with no body content on success. But we can't completely delete the order, as it may be partially filled already. Instead, the DeleteOrder endpoint reduce the order completely, essentially zeroing the remaining resting contracts on it. The zeroed order is returned on the response payload as a form of validation for the client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelCancelOrderResponse]
|
ModelCancelOrderResponse |
Source code in kalshi_py/api/portfolio/cancel_order.py
Asynchronous API Call
kalshi_py.api.portfolio.cancel_order.asyncio(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelCancelOrderResponse]
async
¶
Cancel Order
Endpoint for canceling orders. The value for the orderId should match the id field of the order you want to decrease. Commonly, DELETE-type endpoints return 204 status with no body content on success. But we can't completely delete the order, as it may be partially filled already. Instead, the DeleteOrder endpoint reduce the order completely, essentially zeroing the remaining resting contracts on it. The zeroed order is returned on the response payload as a form of validation for the client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelCancelOrderResponse]
|
ModelCancelOrderResponse |
Source code in kalshi_py/api/portfolio/cancel_order.py
Synchronous Detailed Response
kalshi_py.api.portfolio.cancel_order.sync_detailed(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelCancelOrderResponse]
¶
Cancel Order
Endpoint for canceling orders. The value for the orderId should match the id field of the order you want to decrease. Commonly, DELETE-type endpoints return 204 status with no body content on success. But we can't completely delete the order, as it may be partially filled already. Instead, the DeleteOrder endpoint reduce the order completely, essentially zeroing the remaining resting contracts on it. The zeroed order is returned on the response payload as a form of validation for the client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelCancelOrderResponse]
|
Response[ModelCancelOrderResponse] |
Source code in kalshi_py/api/portfolio/cancel_order.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.cancel_order.asyncio_detailed(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelCancelOrderResponse]
async
¶
Cancel Order
Endpoint for canceling orders. The value for the orderId should match the id field of the order you want to decrease. Commonly, DELETE-type endpoints return 204 status with no body content on success. But we can't completely delete the order, as it may be partially filled already. Instead, the DeleteOrder endpoint reduce the order completely, essentially zeroing the remaining resting contracts on it. The zeroed order is returned on the response payload as a form of validation for the client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelCancelOrderResponse]
|
Response[ModelCancelOrderResponse] |
Source code in kalshi_py/api/portfolio/cancel_order.py
Create Order¶
Synchronous API Call
kalshi_py.api.portfolio.create_order.sync(*, client: Union[AuthenticatedClient, Client], body: ModelCreateOrderRequest) -> Optional[ModelCreateOrderResponse]
¶
Create Order
Endpoint for submitting orders in a market.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelCreateOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelCreateOrderResponse]
|
ModelCreateOrderResponse |
Source code in kalshi_py/api/portfolio/create_order.py
Asynchronous API Call
kalshi_py.api.portfolio.create_order.asyncio(*, client: Union[AuthenticatedClient, Client], body: ModelCreateOrderRequest) -> Optional[ModelCreateOrderResponse]
async
¶
Create Order
Endpoint for submitting orders in a market.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelCreateOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelCreateOrderResponse]
|
ModelCreateOrderResponse |
Source code in kalshi_py/api/portfolio/create_order.py
Synchronous Detailed Response
kalshi_py.api.portfolio.create_order.sync_detailed(*, client: Union[AuthenticatedClient, Client], body: ModelCreateOrderRequest) -> Response[ModelCreateOrderResponse]
¶
Create Order
Endpoint for submitting orders in a market.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelCreateOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelCreateOrderResponse]
|
Response[ModelCreateOrderResponse] |
Source code in kalshi_py/api/portfolio/create_order.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.create_order.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], body: ModelCreateOrderRequest) -> Response[ModelCreateOrderResponse]
async
¶
Create Order
Endpoint for submitting orders in a market.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelCreateOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelCreateOrderResponse]
|
Response[ModelCreateOrderResponse] |
Source code in kalshi_py/api/portfolio/create_order.py
Create Order Group¶
Synchronous API Call
kalshi_py.api.portfolio.create_order_group.sync(*, client: Union[AuthenticatedClient, Client], body: ModelCreateOrderGroupRequest) -> Optional[ModelCreateOrderGroupResponse]
¶
Create Order Group
Creates a new order group with a contracts limit. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelCreateOrderGroupRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelCreateOrderGroupResponse]
|
ModelCreateOrderGroupResponse |
Source code in kalshi_py/api/portfolio/create_order_group.py
Asynchronous API Call
kalshi_py.api.portfolio.create_order_group.asyncio(*, client: Union[AuthenticatedClient, Client], body: ModelCreateOrderGroupRequest) -> Optional[ModelCreateOrderGroupResponse]
async
¶
Create Order Group
Creates a new order group with a contracts limit. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelCreateOrderGroupRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelCreateOrderGroupResponse]
|
ModelCreateOrderGroupResponse |
Source code in kalshi_py/api/portfolio/create_order_group.py
Synchronous Detailed Response
kalshi_py.api.portfolio.create_order_group.sync_detailed(*, client: Union[AuthenticatedClient, Client], body: ModelCreateOrderGroupRequest) -> Response[ModelCreateOrderGroupResponse]
¶
Create Order Group
Creates a new order group with a contracts limit. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelCreateOrderGroupRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelCreateOrderGroupResponse]
|
Response[ModelCreateOrderGroupResponse] |
Source code in kalshi_py/api/portfolio/create_order_group.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.create_order_group.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], body: ModelCreateOrderGroupRequest) -> Response[ModelCreateOrderGroupResponse]
async
¶
Create Order Group
Creates a new order group with a contracts limit. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
ModelCreateOrderGroupRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelCreateOrderGroupResponse]
|
Response[ModelCreateOrderGroupResponse] |
Source code in kalshi_py/api/portfolio/create_order_group.py
Decrease Order¶
Synchronous API Call
kalshi_py.api.portfolio.decrease_order.sync(order_id: str, *, client: Union[AuthenticatedClient, Client], body: ModelDecreaseOrderRequest) -> Optional[ModelDecreaseOrderResponse]
¶
Decrease Order
Endpoint for decreasing the number of contracts in an existing order. This is the only kind of edit available on order quantity. Cancelling an order is equivalent to decreasing an order amount to zero.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
body
|
ModelDecreaseOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelDecreaseOrderResponse]
|
ModelDecreaseOrderResponse |
Source code in kalshi_py/api/portfolio/decrease_order.py
Asynchronous API Call
kalshi_py.api.portfolio.decrease_order.asyncio(order_id: str, *, client: Union[AuthenticatedClient, Client], body: ModelDecreaseOrderRequest) -> Optional[ModelDecreaseOrderResponse]
async
¶
Decrease Order
Endpoint for decreasing the number of contracts in an existing order. This is the only kind of edit available on order quantity. Cancelling an order is equivalent to decreasing an order amount to zero.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
body
|
ModelDecreaseOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelDecreaseOrderResponse]
|
ModelDecreaseOrderResponse |
Source code in kalshi_py/api/portfolio/decrease_order.py
Synchronous Detailed Response
kalshi_py.api.portfolio.decrease_order.sync_detailed(order_id: str, *, client: Union[AuthenticatedClient, Client], body: ModelDecreaseOrderRequest) -> Response[ModelDecreaseOrderResponse]
¶
Decrease Order
Endpoint for decreasing the number of contracts in an existing order. This is the only kind of edit available on order quantity. Cancelling an order is equivalent to decreasing an order amount to zero.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
body
|
ModelDecreaseOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelDecreaseOrderResponse]
|
Response[ModelDecreaseOrderResponse] |
Source code in kalshi_py/api/portfolio/decrease_order.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.decrease_order.asyncio_detailed(order_id: str, *, client: Union[AuthenticatedClient, Client], body: ModelDecreaseOrderRequest) -> Response[ModelDecreaseOrderResponse]
async
¶
Decrease Order
Endpoint for decreasing the number of contracts in an existing order. This is the only kind of edit available on order quantity. Cancelling an order is equivalent to decreasing an order amount to zero.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
body
|
ModelDecreaseOrderRequest
|
|
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelDecreaseOrderResponse]
|
Response[ModelDecreaseOrderResponse] |
Source code in kalshi_py/api/portfolio/decrease_order.py
Delete Order Group¶
Synchronous API Call
kalshi_py.api.portfolio.delete_order_group.sync(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelEmptyResponse]
¶
Delete Order Group
Deletes an order group and cancels all orders within it. This permanently removes the group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelEmptyResponse]
|
ModelEmptyResponse |
Source code in kalshi_py/api/portfolio/delete_order_group.py
Asynchronous API Call
kalshi_py.api.portfolio.delete_order_group.asyncio(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelEmptyResponse]
async
¶
Delete Order Group
Deletes an order group and cancels all orders within it. This permanently removes the group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelEmptyResponse]
|
ModelEmptyResponse |
Source code in kalshi_py/api/portfolio/delete_order_group.py
Synchronous Detailed Response
kalshi_py.api.portfolio.delete_order_group.sync_detailed(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelEmptyResponse]
¶
Delete Order Group
Deletes an order group and cancels all orders within it. This permanently removes the group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelEmptyResponse]
|
Response[ModelEmptyResponse] |
Source code in kalshi_py/api/portfolio/delete_order_group.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.delete_order_group.asyncio_detailed(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelEmptyResponse]
async
¶
Delete Order Group
Deletes an order group and cancels all orders within it. This permanently removes the group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelEmptyResponse]
|
Response[ModelEmptyResponse] |
Source code in kalshi_py/api/portfolio/delete_order_group.py
Get Balance¶
Synchronous API Call
kalshi_py.api.portfolio.get_balance.sync(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetBalanceResponse]
¶
Get Balance
Endpoint for getting the balance of a member. The balance value is returned in cents.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetBalanceResponse]
|
ModelGetBalanceResponse |
Source code in kalshi_py/api/portfolio/get_balance.py
Asynchronous API Call
kalshi_py.api.portfolio.get_balance.asyncio(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetBalanceResponse]
async
¶
Get Balance
Endpoint for getting the balance of a member. The balance value is returned in cents.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetBalanceResponse]
|
ModelGetBalanceResponse |
Source code in kalshi_py/api/portfolio/get_balance.py
Synchronous Detailed Response
kalshi_py.api.portfolio.get_balance.sync_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetBalanceResponse]
¶
Get Balance
Endpoint for getting the balance of a member. The balance value is returned in cents.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetBalanceResponse]
|
Response[ModelGetBalanceResponse] |
Source code in kalshi_py/api/portfolio/get_balance.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.get_balance.asyncio_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetBalanceResponse]
async
¶
Get Balance
Endpoint for getting the balance of a member. The balance value is returned in cents.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetBalanceResponse]
|
Response[ModelGetBalanceResponse] |
Source code in kalshi_py/api/portfolio/get_balance.py
Get Fills¶
Synchronous API Call
kalshi_py.api.portfolio.get_fills.sync(*, client: Union[AuthenticatedClient, Client], ticker: Union[Unset, str] = UNSET, order_id: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, use_dollars: Union[Unset, bool] = UNSET) -> Optional[ModelGetFillsResponse]
¶
Get Fills
Endpoint for getting all fills for the member. A fill is when a trade you have is matched.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ticker
|
Union[Unset, str]
|
Restricts the response to trades in a specific market. |
UNSET
|
order_id
|
Union[Unset, str]
|
Restricts the response to trades related to a specific order. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to trades after a timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to trades before a timestamp. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
use_dollars
|
Union[Unset, bool]
|
Whether to return prices in centi-cent format (0.0001) instead of cent format (0.01). |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetFillsResponse]
|
ModelGetFillsResponse |
Source code in kalshi_py/api/portfolio/get_fills.py
Asynchronous API Call
kalshi_py.api.portfolio.get_fills.asyncio(*, client: Union[AuthenticatedClient, Client], ticker: Union[Unset, str] = UNSET, order_id: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, use_dollars: Union[Unset, bool] = UNSET) -> Optional[ModelGetFillsResponse]
async
¶
Get Fills
Endpoint for getting all fills for the member. A fill is when a trade you have is matched.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ticker
|
Union[Unset, str]
|
Restricts the response to trades in a specific market. |
UNSET
|
order_id
|
Union[Unset, str]
|
Restricts the response to trades related to a specific order. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to trades after a timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to trades before a timestamp. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
use_dollars
|
Union[Unset, bool]
|
Whether to return prices in centi-cent format (0.0001) instead of cent format (0.01). |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetFillsResponse]
|
ModelGetFillsResponse |
Source code in kalshi_py/api/portfolio/get_fills.py
Synchronous Detailed Response
kalshi_py.api.portfolio.get_fills.sync_detailed(*, client: Union[AuthenticatedClient, Client], ticker: Union[Unset, str] = UNSET, order_id: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, use_dollars: Union[Unset, bool] = UNSET) -> Response[ModelGetFillsResponse]
¶
Get Fills
Endpoint for getting all fills for the member. A fill is when a trade you have is matched.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ticker
|
Union[Unset, str]
|
Restricts the response to trades in a specific market. |
UNSET
|
order_id
|
Union[Unset, str]
|
Restricts the response to trades related to a specific order. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to trades after a timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to trades before a timestamp. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
use_dollars
|
Union[Unset, bool]
|
Whether to return prices in centi-cent format (0.0001) instead of cent format (0.01). |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetFillsResponse]
|
Response[ModelGetFillsResponse] |
Source code in kalshi_py/api/portfolio/get_fills.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.get_fills.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], ticker: Union[Unset, str] = UNSET, order_id: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, use_dollars: Union[Unset, bool] = UNSET) -> Response[ModelGetFillsResponse]
async
¶
Get Fills
Endpoint for getting all fills for the member. A fill is when a trade you have is matched.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ticker
|
Union[Unset, str]
|
Restricts the response to trades in a specific market. |
UNSET
|
order_id
|
Union[Unset, str]
|
Restricts the response to trades related to a specific order. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to trades after a timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to trades before a timestamp. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
use_dollars
|
Union[Unset, bool]
|
Whether to return prices in centi-cent format (0.0001) instead of cent format (0.01). |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetFillsResponse]
|
Response[ModelGetFillsResponse] |
Source code in kalshi_py/api/portfolio/get_fills.py
Get Order¶
Synchronous API Call
kalshi_py.api.portfolio.get_order.sync(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetOrderResponse]
¶
Get Order
Endpoint for getting a single order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrderResponse]
|
ModelGetOrderResponse |
Source code in kalshi_py/api/portfolio/get_order.py
Asynchronous API Call
kalshi_py.api.portfolio.get_order.asyncio(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetOrderResponse]
async
¶
Get Order
Endpoint for getting a single order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrderResponse]
|
ModelGetOrderResponse |
Source code in kalshi_py/api/portfolio/get_order.py
Synchronous Detailed Response
kalshi_py.api.portfolio.get_order.sync_detailed(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetOrderResponse]
¶
Get Order
Endpoint for getting a single order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrderResponse]
|
Response[ModelGetOrderResponse] |
Source code in kalshi_py/api/portfolio/get_order.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.get_order.asyncio_detailed(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetOrderResponse]
async
¶
Get Order
Endpoint for getting a single order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrderResponse]
|
Response[ModelGetOrderResponse] |
Source code in kalshi_py/api/portfolio/get_order.py
Get Order Group¶
Synchronous API Call
kalshi_py.api.portfolio.get_order_group.sync(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetOrderGroupResponse]
¶
Get Order Group
Retrieves details for a single order group including all order IDs and auto-cancel status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrderGroupResponse]
|
ModelGetOrderGroupResponse |
Source code in kalshi_py/api/portfolio/get_order_group.py
Asynchronous API Call
kalshi_py.api.portfolio.get_order_group.asyncio(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetOrderGroupResponse]
async
¶
Get Order Group
Retrieves details for a single order group including all order IDs and auto-cancel status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrderGroupResponse]
|
ModelGetOrderGroupResponse |
Source code in kalshi_py/api/portfolio/get_order_group.py
Synchronous Detailed Response
kalshi_py.api.portfolio.get_order_group.sync_detailed(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetOrderGroupResponse]
¶
Get Order Group
Retrieves details for a single order group including all order IDs and auto-cancel status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrderGroupResponse]
|
Response[ModelGetOrderGroupResponse] |
Source code in kalshi_py/api/portfolio/get_order_group.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.get_order_group.asyncio_detailed(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetOrderGroupResponse]
async
¶
Get Order Group
Retrieves details for a single order group including all order IDs and auto-cancel status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrderGroupResponse]
|
Response[ModelGetOrderGroupResponse] |
Source code in kalshi_py/api/portfolio/get_order_group.py
Get Order Groups¶
Synchronous API Call
kalshi_py.api.portfolio.get_order_groups.sync(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetOrderGroupsResponse]
¶
Get Order Groups
Retrieves all order groups for the authenticated user.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrderGroupsResponse]
|
ModelGetOrderGroupsResponse |
Source code in kalshi_py/api/portfolio/get_order_groups.py
Asynchronous API Call
kalshi_py.api.portfolio.get_order_groups.asyncio(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetOrderGroupsResponse]
async
¶
Get Order Groups
Retrieves all order groups for the authenticated user.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrderGroupsResponse]
|
ModelGetOrderGroupsResponse |
Source code in kalshi_py/api/portfolio/get_order_groups.py
Synchronous Detailed Response
kalshi_py.api.portfolio.get_order_groups.sync_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetOrderGroupsResponse]
¶
Get Order Groups
Retrieves all order groups for the authenticated user.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrderGroupsResponse]
|
Response[ModelGetOrderGroupsResponse] |
Source code in kalshi_py/api/portfolio/get_order_groups.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.get_order_groups.asyncio_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetOrderGroupsResponse]
async
¶
Get Order Groups
Retrieves all order groups for the authenticated user.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrderGroupsResponse]
|
Response[ModelGetOrderGroupsResponse] |
Source code in kalshi_py/api/portfolio/get_order_groups.py
Get Order Queue Position¶
Synchronous API Call
kalshi_py.api.portfolio.get_order_queue_position.sync(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetOrderQueuePositionResponse]
¶
Get Queue Position for Order
Endpoint for getting an order's queue position in the order book. This represents the amount of orders that need to be matched before this order receives a partial or full match. Queue position is determined using a price-time priority.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrderQueuePositionResponse]
|
ModelGetOrderQueuePositionResponse |
Source code in kalshi_py/api/portfolio/get_order_queue_position.py
Asynchronous API Call
kalshi_py.api.portfolio.get_order_queue_position.asyncio(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetOrderQueuePositionResponse]
async
¶
Get Queue Position for Order
Endpoint for getting an order's queue position in the order book. This represents the amount of orders that need to be matched before this order receives a partial or full match. Queue position is determined using a price-time priority.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrderQueuePositionResponse]
|
ModelGetOrderQueuePositionResponse |
Source code in kalshi_py/api/portfolio/get_order_queue_position.py
Synchronous Detailed Response
kalshi_py.api.portfolio.get_order_queue_position.sync_detailed(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetOrderQueuePositionResponse]
¶
Get Queue Position for Order
Endpoint for getting an order's queue position in the order book. This represents the amount of orders that need to be matched before this order receives a partial or full match. Queue position is determined using a price-time priority.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrderQueuePositionResponse]
|
Response[ModelGetOrderQueuePositionResponse] |
Source code in kalshi_py/api/portfolio/get_order_queue_position.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.get_order_queue_position.asyncio_detailed(order_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetOrderQueuePositionResponse]
async
¶
Get Queue Position for Order
Endpoint for getting an order's queue position in the order book. This represents the amount of orders that need to be matched before this order receives a partial or full match. Queue position is determined using a price-time priority.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_id
|
str
|
Order ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrderQueuePositionResponse]
|
Response[ModelGetOrderQueuePositionResponse] |
Source code in kalshi_py/api/portfolio/get_order_queue_position.py
Get Order Queue Positions¶
Synchronous API Call
kalshi_py.api.portfolio.get_order_queue_positions.sync(*, client: Union[AuthenticatedClient, Client], market_tickers: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET) -> Optional[ModelGetOrderQueuePositionsResponse]
¶
Get Queue Positions for Orders
Endpoint for getting queue positions for all resting orders. Queue position represents the number of contracts that need to be matched before an order receives a partial or full match, determined using price-time priority.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
market_tickers
|
Union[Unset, str]
|
Comma-separated list of market tickers to filter by |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Event ticker to filter by |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrderQueuePositionsResponse]
|
ModelGetOrderQueuePositionsResponse |
Source code in kalshi_py/api/portfolio/get_order_queue_positions.py
Asynchronous API Call
kalshi_py.api.portfolio.get_order_queue_positions.asyncio(*, client: Union[AuthenticatedClient, Client], market_tickers: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET) -> Optional[ModelGetOrderQueuePositionsResponse]
async
¶
Get Queue Positions for Orders
Endpoint for getting queue positions for all resting orders. Queue position represents the number of contracts that need to be matched before an order receives a partial or full match, determined using price-time priority.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
market_tickers
|
Union[Unset, str]
|
Comma-separated list of market tickers to filter by |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Event ticker to filter by |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrderQueuePositionsResponse]
|
ModelGetOrderQueuePositionsResponse |
Source code in kalshi_py/api/portfolio/get_order_queue_positions.py
Synchronous Detailed Response
kalshi_py.api.portfolio.get_order_queue_positions.sync_detailed(*, client: Union[AuthenticatedClient, Client], market_tickers: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET) -> Response[ModelGetOrderQueuePositionsResponse]
¶
Get Queue Positions for Orders
Endpoint for getting queue positions for all resting orders. Queue position represents the number of contracts that need to be matched before an order receives a partial or full match, determined using price-time priority.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
market_tickers
|
Union[Unset, str]
|
Comma-separated list of market tickers to filter by |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Event ticker to filter by |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrderQueuePositionsResponse]
|
Response[ModelGetOrderQueuePositionsResponse] |
Source code in kalshi_py/api/portfolio/get_order_queue_positions.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.get_order_queue_positions.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], market_tickers: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET) -> Response[ModelGetOrderQueuePositionsResponse]
async
¶
Get Queue Positions for Orders
Endpoint for getting queue positions for all resting orders. Queue position represents the number of contracts that need to be matched before an order receives a partial or full match, determined using price-time priority.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
market_tickers
|
Union[Unset, str]
|
Comma-separated list of market tickers to filter by |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Event ticker to filter by |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrderQueuePositionsResponse]
|
Response[ModelGetOrderQueuePositionsResponse] |
Source code in kalshi_py/api/portfolio/get_order_queue_positions.py
Get Orders¶
Synchronous API Call
kalshi_py.api.portfolio.get_orders.sync(*, client: Union[AuthenticatedClient, Client], ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, status: Union[Unset, str] = UNSET, cursor: Union[Unset, str] = UNSET, limit: Union[Unset, int] = UNSET) -> Optional[ModelGetOrdersResponse]
¶
Get Orders
Endpoint for getting all orders for the member.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ticker
|
Union[Unset, str]
|
Restricts the response to orders in a single market. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Restricts the response to orders in a single event. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to orders after a timestamp, formatted as a Unix Timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to orders before a timestamp, formatted as a Unix Timestamp. |
UNSET
|
status
|
Union[Unset, str]
|
Restricts the response to orders that have a certain status: resting, canceled, or executed. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrdersResponse]
|
ModelGetOrdersResponse |
Source code in kalshi_py/api/portfolio/get_orders.py
Asynchronous API Call
kalshi_py.api.portfolio.get_orders.asyncio(*, client: Union[AuthenticatedClient, Client], ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, status: Union[Unset, str] = UNSET, cursor: Union[Unset, str] = UNSET, limit: Union[Unset, int] = UNSET) -> Optional[ModelGetOrdersResponse]
async
¶
Get Orders
Endpoint for getting all orders for the member.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ticker
|
Union[Unset, str]
|
Restricts the response to orders in a single market. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Restricts the response to orders in a single event. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to orders after a timestamp, formatted as a Unix Timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to orders before a timestamp, formatted as a Unix Timestamp. |
UNSET
|
status
|
Union[Unset, str]
|
Restricts the response to orders that have a certain status: resting, canceled, or executed. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetOrdersResponse]
|
ModelGetOrdersResponse |
Source code in kalshi_py/api/portfolio/get_orders.py
Synchronous Detailed Response
kalshi_py.api.portfolio.get_orders.sync_detailed(*, client: Union[AuthenticatedClient, Client], ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, status: Union[Unset, str] = UNSET, cursor: Union[Unset, str] = UNSET, limit: Union[Unset, int] = UNSET) -> Response[ModelGetOrdersResponse]
¶
Get Orders
Endpoint for getting all orders for the member.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ticker
|
Union[Unset, str]
|
Restricts the response to orders in a single market. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Restricts the response to orders in a single event. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to orders after a timestamp, formatted as a Unix Timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to orders before a timestamp, formatted as a Unix Timestamp. |
UNSET
|
status
|
Union[Unset, str]
|
Restricts the response to orders that have a certain status: resting, canceled, or executed. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrdersResponse]
|
Response[ModelGetOrdersResponse] |
Source code in kalshi_py/api/portfolio/get_orders.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.get_orders.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, status: Union[Unset, str] = UNSET, cursor: Union[Unset, str] = UNSET, limit: Union[Unset, int] = UNSET) -> Response[ModelGetOrdersResponse]
async
¶
Get Orders
Endpoint for getting all orders for the member.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ticker
|
Union[Unset, str]
|
Restricts the response to orders in a single market. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Restricts the response to orders in a single event. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to orders after a timestamp, formatted as a Unix Timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to orders before a timestamp, formatted as a Unix Timestamp. |
UNSET
|
status
|
Union[Unset, str]
|
Restricts the response to orders that have a certain status: resting, canceled, or executed. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetOrdersResponse]
|
Response[ModelGetOrdersResponse] |
Source code in kalshi_py/api/portfolio/get_orders.py
Get Portfolio Resting Order Total Value¶
Synchronous API Call
kalshi_py.api.portfolio.get_portfolio_resting_order_total_value.sync(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetUserRestingOrderTotalValueResponse]
¶
Get Portfolio Resting Order Total Value
Endpoint for getting the total value, in cents, of resting orders. This endpoint is only intended for use by FCM members (rare). Note: If you're uncertain about this endpoint, it likely does not apply to you.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetUserRestingOrderTotalValueResponse]
|
ModelGetUserRestingOrderTotalValueResponse |
Source code in kalshi_py/api/portfolio/get_portfolio_resting_order_total_value.py
Asynchronous API Call
kalshi_py.api.portfolio.get_portfolio_resting_order_total_value.asyncio(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetUserRestingOrderTotalValueResponse]
async
¶
Get Portfolio Resting Order Total Value
Endpoint for getting the total value, in cents, of resting orders. This endpoint is only intended for use by FCM members (rare). Note: If you're uncertain about this endpoint, it likely does not apply to you.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetUserRestingOrderTotalValueResponse]
|
ModelGetUserRestingOrderTotalValueResponse |
Source code in kalshi_py/api/portfolio/get_portfolio_resting_order_total_value.py
Synchronous Detailed Response
kalshi_py.api.portfolio.get_portfolio_resting_order_total_value.sync_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetUserRestingOrderTotalValueResponse]
¶
Get Portfolio Resting Order Total Value
Endpoint for getting the total value, in cents, of resting orders. This endpoint is only intended for use by FCM members (rare). Note: If you're uncertain about this endpoint, it likely does not apply to you.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetUserRestingOrderTotalValueResponse]
|
Response[ModelGetUserRestingOrderTotalValueResponse] |
Source code in kalshi_py/api/portfolio/get_portfolio_resting_order_total_value.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.get_portfolio_resting_order_total_value.asyncio_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetUserRestingOrderTotalValueResponse]
async
¶
Get Portfolio Resting Order Total Value
Endpoint for getting the total value, in cents, of resting orders. This endpoint is only intended for use by FCM members (rare). Note: If you're uncertain about this endpoint, it likely does not apply to you.
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetUserRestingOrderTotalValueResponse]
|
Response[ModelGetUserRestingOrderTotalValueResponse] |
Source code in kalshi_py/api/portfolio/get_portfolio_resting_order_total_value.py
Get Positions¶
Synchronous API Call
kalshi_py.api.portfolio.get_positions.sync(*, client: Union[AuthenticatedClient, Client], cursor: Union[Unset, str] = UNSET, limit: Union[Unset, int] = UNSET, count_filter: Union[Unset, str] = UNSET, settlement_status: Union[Unset, str] = UNSET, ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET) -> Optional[ModelGetPositionsResponse]
¶
Get Positions
Endpoint for getting all market positions for the member.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
count_filter
|
Union[Unset, str]
|
Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted: position, total_traded, resting_order_count |
UNSET
|
settlement_status
|
Union[Unset, str]
|
Settlement status of the markets to return. Defaults to unsettled. |
UNSET
|
ticker
|
Union[Unset, str]
|
Ticker of desired positions. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Event ticker of desired positions. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetPositionsResponse]
|
ModelGetPositionsResponse |
Source code in kalshi_py/api/portfolio/get_positions.py
Asynchronous API Call
kalshi_py.api.portfolio.get_positions.asyncio(*, client: Union[AuthenticatedClient, Client], cursor: Union[Unset, str] = UNSET, limit: Union[Unset, int] = UNSET, count_filter: Union[Unset, str] = UNSET, settlement_status: Union[Unset, str] = UNSET, ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET) -> Optional[ModelGetPositionsResponse]
async
¶
Get Positions
Endpoint for getting all market positions for the member.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
count_filter
|
Union[Unset, str]
|
Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted: position, total_traded, resting_order_count |
UNSET
|
settlement_status
|
Union[Unset, str]
|
Settlement status of the markets to return. Defaults to unsettled. |
UNSET
|
ticker
|
Union[Unset, str]
|
Ticker of desired positions. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Event ticker of desired positions. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetPositionsResponse]
|
ModelGetPositionsResponse |
Source code in kalshi_py/api/portfolio/get_positions.py
Synchronous Detailed Response
kalshi_py.api.portfolio.get_positions.sync_detailed(*, client: Union[AuthenticatedClient, Client], cursor: Union[Unset, str] = UNSET, limit: Union[Unset, int] = UNSET, count_filter: Union[Unset, str] = UNSET, settlement_status: Union[Unset, str] = UNSET, ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET) -> Response[ModelGetPositionsResponse]
¶
Get Positions
Endpoint for getting all market positions for the member.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
count_filter
|
Union[Unset, str]
|
Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted: position, total_traded, resting_order_count |
UNSET
|
settlement_status
|
Union[Unset, str]
|
Settlement status of the markets to return. Defaults to unsettled. |
UNSET
|
ticker
|
Union[Unset, str]
|
Ticker of desired positions. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Event ticker of desired positions. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetPositionsResponse]
|
Response[ModelGetPositionsResponse] |
Source code in kalshi_py/api/portfolio/get_positions.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.get_positions.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], cursor: Union[Unset, str] = UNSET, limit: Union[Unset, int] = UNSET, count_filter: Union[Unset, str] = UNSET, settlement_status: Union[Unset, str] = UNSET, ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET) -> Response[ModelGetPositionsResponse]
async
¶
Get Positions
Endpoint for getting all market positions for the member.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
count_filter
|
Union[Unset, str]
|
Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted: position, total_traded, resting_order_count |
UNSET
|
settlement_status
|
Union[Unset, str]
|
Settlement status of the markets to return. Defaults to unsettled. |
UNSET
|
ticker
|
Union[Unset, str]
|
Ticker of desired positions. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Event ticker of desired positions. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetPositionsResponse]
|
Response[ModelGetPositionsResponse] |
Source code in kalshi_py/api/portfolio/get_positions.py
Get Settlements¶
Synchronous API Call
kalshi_py.api.portfolio.get_settlements.sync(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET) -> Optional[ModelGetSettlementsResponse]
¶
Get Settlements
Endpoint for getting the member's settlements historical track.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
ticker
|
Union[Unset, str]
|
Restricts the response to settlements in a specific market. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Restricts the response to settlements in a single event. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to settlements after a timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to settlements before a timestamp. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetSettlementsResponse]
|
ModelGetSettlementsResponse |
Source code in kalshi_py/api/portfolio/get_settlements.py
Asynchronous API Call
kalshi_py.api.portfolio.get_settlements.asyncio(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET) -> Optional[ModelGetSettlementsResponse]
async
¶
Get Settlements
Endpoint for getting the member's settlements historical track.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
ticker
|
Union[Unset, str]
|
Restricts the response to settlements in a specific market. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Restricts the response to settlements in a single event. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to settlements after a timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to settlements before a timestamp. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelGetSettlementsResponse]
|
ModelGetSettlementsResponse |
Source code in kalshi_py/api/portfolio/get_settlements.py
Synchronous Detailed Response
kalshi_py.api.portfolio.get_settlements.sync_detailed(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET) -> Response[ModelGetSettlementsResponse]
¶
Get Settlements
Endpoint for getting the member's settlements historical track.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
ticker
|
Union[Unset, str]
|
Restricts the response to settlements in a specific market. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Restricts the response to settlements in a single event. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to settlements after a timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to settlements before a timestamp. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetSettlementsResponse]
|
Response[ModelGetSettlementsResponse] |
Source code in kalshi_py/api/portfolio/get_settlements.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.get_settlements.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, ticker: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET) -> Response[ModelGetSettlementsResponse]
async
¶
Get Settlements
Endpoint for getting the member's settlements historical track.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
Union[Unset, int]
|
Parameter to specify the number of results per page. Defaults to 100. |
UNSET
|
ticker
|
Union[Unset, str]
|
Restricts the response to settlements in a specific market. |
UNSET
|
event_ticker
|
Union[Unset, str]
|
Restricts the response to settlements in a single event. |
UNSET
|
min_ts
|
Union[Unset, int]
|
Restricts the response to settlements after a timestamp. |
UNSET
|
max_ts
|
Union[Unset, int]
|
Restricts the response to settlements before a timestamp. |
UNSET
|
cursor
|
Union[Unset, str]
|
The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page. |
UNSET
|
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelGetSettlementsResponse]
|
Response[ModelGetSettlementsResponse] |
Source code in kalshi_py/api/portfolio/get_settlements.py
Reset Order Group¶
Synchronous API Call
kalshi_py.api.portfolio.reset_order_group.sync(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelEmptyResponse]
¶
Reset Order Group
Resets the order group's matched contracts counter to zero, allowing new orders to be placed again after the limit was hit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelEmptyResponse]
|
ModelEmptyResponse |
Source code in kalshi_py/api/portfolio/reset_order_group.py
Asynchronous API Call
kalshi_py.api.portfolio.reset_order_group.asyncio(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelEmptyResponse]
async
¶
Reset Order Group
Resets the order group's matched contracts counter to zero, allowing new orders to be placed again after the limit was hit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Optional[ModelEmptyResponse]
|
ModelEmptyResponse |
Source code in kalshi_py/api/portfolio/reset_order_group.py
Synchronous Detailed Response
kalshi_py.api.portfolio.reset_order_group.sync_detailed(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelEmptyResponse]
¶
Reset Order Group
Resets the order group's matched contracts counter to zero, allowing new orders to be placed again after the limit was hit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelEmptyResponse]
|
Response[ModelEmptyResponse] |
Source code in kalshi_py/api/portfolio/reset_order_group.py
Asynchronous Detailed Response
kalshi_py.api.portfolio.reset_order_group.asyncio_detailed(order_group_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelEmptyResponse]
async
¶
Reset Order Group
Resets the order group's matched contracts counter to zero, allowing new orders to be placed again after the limit was hit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_group_id
|
str
|
Order group ID |
required |
Raises:
Type | Description |
---|---|
UnexpectedStatus
|
If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
TimeoutException
|
If the request takes longer than Client.timeout. |
Returns:
Type | Description |
---|---|
Response[ModelEmptyResponse]
|
Response[ModelEmptyResponse] |