UNPKG

kalshi-typescript

Version:
261 lines (166 loc) 9.04 kB
# OrderGroupsApi All URIs are relative to *https://api.elections.kalshi.com/trade-api/v2* |Method | HTTP request | Description| |------------- | ------------- | -------------| |[**createOrderGroup**](#createordergroup) | **POST** /portfolio/order_groups/create | Create Order Group| |[**deleteOrderGroup**](#deleteordergroup) | **DELETE** /portfolio/order_groups/{order_group_id} | Delete Order Group| |[**getOrderGroup**](#getordergroup) | **GET** /portfolio/order_groups/{order_group_id} | Get Order Group| |[**getOrderGroups**](#getordergroups) | **GET** /portfolio/order_groups | Get Order Groups| |[**resetOrderGroup**](#resetordergroup) | **PUT** /portfolio/order_groups/{order_group_id}/reset | Reset Order Group| |[**triggerOrderGroup**](#triggerordergroup) | **PUT** /portfolio/order_groups/{order_group_id}/trigger | Trigger Order Group| |[**updateOrderGroupLimit**](#updateordergrouplimit) | **PUT** /portfolio/order_groups/{order_group_id}/limit | Update Order Group Limit| # **createOrderGroup** > CreateOrderGroupResponse createOrderGroup(createOrderGroupRequest) Creates a new order group with a contracts limit measured over a rolling 15-second window. 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 | Notes| |------------- | ------------- | ------------- | -------------| | **createOrderGroupRequest** | **CreateOrderGroupRequest**| | | ### Return type **CreateOrderGroupResponse** ### Authorization [kalshiAccessSignature](../README.md#kalshiAccessSignature), [kalshiAccessKey](../README.md#kalshiAccessKey), [kalshiAccessTimestamp](../README.md#kalshiAccessTimestamp) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**201** | Order group created successfully | - | |**400** | Bad request - invalid input | - | |**401** | Unauthorized - authentication required | - | |**500** | Internal server error | - | # **deleteOrderGroup** > object deleteOrderGroup() Deletes an order group and cancels all orders within it. This permanently removes the group. ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **orderGroupId** | [**string**] | Order group ID | defaults to undefined| | **subaccount** | [**number**] | Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. | (optional) defaults to undefined| ### Return type **object** ### Authorization [kalshiAccessSignature](../README.md#kalshiAccessSignature), [kalshiAccessKey](../README.md#kalshiAccessKey), [kalshiAccessTimestamp](../README.md#kalshiAccessTimestamp) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Order group deleted successfully | - | |**401** | Unauthorized - authentication required | - | |**404** | Resource not found | - | |**500** | Internal server error | - | # **getOrderGroup** > GetOrderGroupResponse getOrderGroup() Retrieves details for a single order group including all order IDs and auto-cancel status. ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **orderGroupId** | [**string**] | Order group ID | defaults to undefined| | **subaccount** | [**number**] | Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts. | (optional) defaults to undefined| ### Return type **GetOrderGroupResponse** ### Authorization [kalshiAccessSignature](../README.md#kalshiAccessSignature), [kalshiAccessKey](../README.md#kalshiAccessKey), [kalshiAccessTimestamp](../README.md#kalshiAccessTimestamp) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Order group retrieved successfully | - | |**401** | Unauthorized - authentication required | - | |**404** | Resource not found | - | |**500** | Internal server error | - | # **getOrderGroups** > GetOrderGroupsResponse getOrderGroups() Retrieves all order groups for the authenticated user. ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **subaccount** | [**number**] | Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts. | (optional) defaults to undefined| ### Return type **GetOrderGroupsResponse** ### Authorization [kalshiAccessSignature](../README.md#kalshiAccessSignature), [kalshiAccessKey](../README.md#kalshiAccessKey), [kalshiAccessTimestamp](../README.md#kalshiAccessTimestamp) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Order groups retrieved successfully | - | |**400** | Bad request - invalid input | - | |**401** | Unauthorized - authentication required | - | |**500** | Internal server error | - | # **resetOrderGroup** > object resetOrderGroup() 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 | Notes| |------------- | ------------- | ------------- | -------------| | **body** | **object**| | | | **orderGroupId** | [**string**] | Order group ID | defaults to undefined| | **subaccount** | [**number**] | Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. | (optional) defaults to undefined| ### Return type **object** ### Authorization [kalshiAccessSignature](../README.md#kalshiAccessSignature), [kalshiAccessKey](../README.md#kalshiAccessKey), [kalshiAccessTimestamp](../README.md#kalshiAccessTimestamp) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Order group reset successfully | - | |**401** | Unauthorized - authentication required | - | |**404** | Resource not found | - | |**500** | Internal server error | - | # **triggerOrderGroup** > object triggerOrderGroup() Triggers the order group, canceling all orders in the group and preventing new orders until the group is reset. ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **body** | **object**| | | | **orderGroupId** | [**string**] | Order group ID | defaults to undefined| | **subaccount** | [**number**] | Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. | (optional) defaults to undefined| ### Return type **object** ### Authorization [kalshiAccessSignature](../README.md#kalshiAccessSignature), [kalshiAccessKey](../README.md#kalshiAccessKey), [kalshiAccessTimestamp](../README.md#kalshiAccessTimestamp) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Order group triggered successfully | - | |**401** | Unauthorized - authentication required | - | |**404** | Resource not found | - | |**500** | Internal server error | - | # **updateOrderGroupLimit** > object updateOrderGroupLimit(updateOrderGroupLimitRequest) Updates the order group contracts limit (rolling 15-second window). If the updated limit would immediately trigger the group, all orders in the group are canceled and the group is triggered. ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **updateOrderGroupLimitRequest** | **UpdateOrderGroupLimitRequest**| | | | **orderGroupId** | [**string**] | Order group ID | defaults to undefined| ### Return type **object** ### Authorization [kalshiAccessSignature](../README.md#kalshiAccessSignature), [kalshiAccessKey](../README.md#kalshiAccessKey), [kalshiAccessTimestamp](../README.md#kalshiAccessTimestamp) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Order group limit updated successfully | - | |**400** | Bad request - invalid input | - | |**401** | Unauthorized - authentication required | - | |**404** | Resource not found | - | |**500** | Internal server error | - |