kalshi-typescript
Version:
OpenAPI client for kalshi-typescript
394 lines (251 loc) • 15.1 kB
Markdown
# PortfolioApi
All URIs are relative to *https://api.elections.kalshi.com/trade-api/v2*
|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**applySubaccountTransfer**](#applysubaccounttransfer) | **POST** /portfolio/subaccounts/transfer | Transfer Between Subaccounts|
|[**createSubaccount**](#createsubaccount) | **POST** /portfolio/subaccounts | Create Subaccount|
|[**getBalance**](#getbalance) | **GET** /portfolio/balance | Get Balance|
|[**getFills**](#getfills) | **GET** /portfolio/fills | Get Fills|
|[**getPortfolioRestingOrderTotalValue**](#getportfoliorestingordertotalvalue) | **GET** /portfolio/summary/total_resting_order_value | Get Total Resting Order Value|
|[**getPositions**](#getpositions) | **GET** /portfolio/positions | Get Positions|
|[**getSettlements**](#getsettlements) | **GET** /portfolio/settlements | Get Settlements|
|[**getSubaccountBalances**](#getsubaccountbalances) | **GET** /portfolio/subaccounts/balances | Get All Subaccount Balances|
|[**getSubaccountNetting**](#getsubaccountnetting) | **GET** /portfolio/subaccounts/netting | Get Subaccount Netting|
|[**getSubaccountTransfers**](#getsubaccounttransfers) | **GET** /portfolio/subaccounts/transfers | Get Subaccount Transfers|
|[**updateSubaccountNetting**](#updatesubaccountnetting) | **PUT** /portfolio/subaccounts/netting | Update Subaccount Netting|
# **applySubaccountTransfer**
> object applySubaccountTransfer(applySubaccountTransferRequest)
Transfers funds between the authenticated user\'s subaccounts. Use 0 for the primary account, or 1-32 for numbered subaccounts.
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **applySubaccountTransferRequest** | **ApplySubaccountTransferRequest**| | |
### 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** | Transfer completed successfully | - |
|**400** | Bad request - invalid input | - |
|**401** | Unauthorized - authentication required | - |
|**500** | Internal server error | - |
# **createSubaccount**
> CreateSubaccountResponse createSubaccount()
Creates a new subaccount for the authenticated user. Subaccounts are numbered sequentially starting from 1. Maximum 32 subaccounts per user.
### Parameters
This endpoint does not have any parameters.
### Return type
**CreateSubaccountResponse**
### 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 |
|-------------|-------------|------------------|
|**201** | Subaccount created successfully | - |
|**400** | Bad request - invalid input | - |
|**401** | Unauthorized - authentication required | - |
|**500** | Internal server error | - |
# **getBalance**
> GetBalanceResponse getBalance()
Endpoint for getting the balance and portfolio value of a member. Both values are returned in cents.
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **subaccount** | [**number**] | Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. | (optional) defaults to undefined|
### Return type
**GetBalanceResponse**
### 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** | Balance retrieved successfully | - |
|**401** | Unauthorized - authentication required | - |
|**500** | Internal server error | - |
# **getFills**
> GetFillsResponse getFills()
Endpoint for getting all fills for the member. A fill is when a trade you have is matched. Fills that occurred before the historical cutoff are only available via `GET /historical/fills`. See [Historical Data](https://kalshi.com/docs/getting_started/historical_data) for details.
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **ticker** | [**string**] | Filter by market ticker | (optional) defaults to undefined|
| **orderId** | [**string**] | Filter by order ID | (optional) defaults to undefined|
| **minTs** | [**number**] | Filter items after this Unix timestamp | (optional) defaults to undefined|
| **maxTs** | [**number**] | Filter items before this Unix timestamp | (optional) defaults to undefined|
| **limit** | [**number**] | Number of results per page. Defaults to 100. Maximum value is 200. | (optional) defaults to 100|
| **cursor** | [**string**] | Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. | (optional) 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
**GetFillsResponse**
### 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** | Fills retrieved successfully | - |
|**400** | Bad request | - |
|**401** | Unauthorized | - |
|**500** | Internal server error | - |
# **getPortfolioRestingOrderTotalValue**
> GetPortfolioRestingOrderTotalValueResponse getPortfolioRestingOrderTotalValue()
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.
### Parameters
This endpoint does not have any parameters.
### Return type
**GetPortfolioRestingOrderTotalValueResponse**
### 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** | Total resting order value retrieved successfully | - |
|**401** | Unauthorized - authentication required | - |
|**500** | Internal server error | - |
# **getPositions**
> GetPositionsResponse getPositions()
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
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **cursor** | [**string**] | 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. | (optional) defaults to undefined|
| **limit** | [**number**] | Parameter to specify the number of results per page. Defaults to 100. | (optional) defaults to 100|
| **countFilter** | [**string**] | 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 | (optional) defaults to undefined|
| **ticker** | [**string**] | Filter by market ticker | (optional) defaults to undefined|
| **eventTicker** | [**string**] | Event ticker to filter by. Only a single event ticker is supported. | (optional) defaults to undefined|
| **subaccount** | [**number**] | Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. | (optional) defaults to undefined|
### Return type
**GetPositionsResponse**
### 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** | Positions retrieved successfully | - |
|**400** | Bad request - invalid input | - |
|**401** | Unauthorized - authentication required | - |
|**500** | Internal server error | - |
# **getSettlements**
> GetSettlementsResponse getSettlements()
Endpoint for getting the member\'s settlements historical track.
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **limit** | [**number**] | Number of results per page. Defaults to 100. Maximum value is 200. | (optional) defaults to 100|
| **cursor** | [**string**] | Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. | (optional) defaults to undefined|
| **ticker** | [**string**] | Filter by market ticker | (optional) defaults to undefined|
| **eventTicker** | [**string**] | Event ticker to filter by. Only a single event ticker is supported. | (optional) defaults to undefined|
| **minTs** | [**number**] | Filter items after this Unix timestamp | (optional) defaults to undefined|
| **maxTs** | [**number**] | Filter items before this Unix timestamp | (optional) 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
**GetSettlementsResponse**
### 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** | Settlements retrieved successfully | - |
|**400** | Bad request - invalid input | - |
|**401** | Unauthorized - authentication required | - |
|**500** | Internal server error | - |
# **getSubaccountBalances**
> GetSubaccountBalancesResponse getSubaccountBalances()
Gets balances for all subaccounts including the primary account.
### Parameters
This endpoint does not have any parameters.
### Return type
**GetSubaccountBalancesResponse**
### 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** | Balances retrieved successfully | - |
|**401** | Unauthorized - authentication required | - |
|**500** | Internal server error | - |
# **getSubaccountNetting**
> GetSubaccountNettingResponse getSubaccountNetting()
Gets the netting enabled settings for all subaccounts.
### Parameters
This endpoint does not have any parameters.
### Return type
**GetSubaccountNettingResponse**
### 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** | Netting settings retrieved successfully | - |
|**401** | Unauthorized - authentication required | - |
|**500** | Internal server error | - |
# **getSubaccountTransfers**
> GetSubaccountTransfersResponse getSubaccountTransfers()
Gets a paginated list of all transfers between subaccounts for the authenticated user.
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **limit** | [**number**] | Number of results per page. Defaults to 100. Maximum value is 200. | (optional) defaults to 100|
| **cursor** | [**string**] | Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. | (optional) defaults to undefined|
### Return type
**GetSubaccountTransfersResponse**
### 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** | Transfers retrieved successfully | - |
|**401** | Unauthorized - authentication required | - |
|**500** | Internal server error | - |
# **updateSubaccountNetting**
> updateSubaccountNetting(updateSubaccountNettingRequest)
Updates the netting enabled setting for a specific subaccount. Use 0 for the primary account, or 1-32 for numbered subaccounts.
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **updateSubaccountNettingRequest** | **UpdateSubaccountNettingRequest**| | |
### Return type
void (empty response body)
### 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** | Netting setting updated successfully | - |
|**400** | Bad request - invalid input | - |
|**401** | Unauthorized - authentication required | - |
|**500** | Internal server error | - |