All URIs are relative to https://api.elections.kalshi.com/trade-api/v2
MethodHTTP requestDescription
amendOrderPOST /portfolio/orders//amendAmend Order
batchCancelOrdersDELETE /portfolio/orders/batchedBatch Cancel Orders
batchCreateOrdersPOST /portfolio/orders/batchedBatch Create Orders
cancelOrderDELETE /portfolio/orders/Cancel Order
createOrderPOST /portfolio/ordersCreate Order
createOrderGroupPOST /portfolio/order_groups/createCreate Order Group
decreaseOrderPOST /portfolio/orders//decreaseDecrease Order
deleteOrderGroupDELETE /portfolio/order_groups/Delete Order Group
getBalanceGET /portfolio/balanceGet Balance
getFillsGET /portfolio/fillsGet Fills
getOrderGET /portfolio/orders/Get Order
getOrderGroupsGET /portfolio/order_groupsGet Order Groups
getOrderQueuePositionGET /portfolio/orders//queue_positionGet Order Queue Position
getOrdersGET /portfolio/ordersGet Orders
getPositionsGET /portfolio/positionsGet Positions
getQueuePositionsPOST /portfolio/orders/queue_positionsGet Queue Positions
getSettlementsGET /portfolio/settlementsGet Settlements
getTotalRestingOrderValueGET /portfolio/summary/total_resting_order_valueGet Total Resting Order Value
resetOrderGroupPOST /portfolio/order_groups//resetReset Order Group

amendOrder

AmendOrderResponse amendOrder(amendOrderRequest)
Amend an existing order

Example

import {
    PortfolioApi,
    Configuration,
    AmendOrderRequest
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let orderId: string; //Order ID (default to undefined)
let amendOrderRequest: AmendOrderRequest; //

const { status, data } = await apiInstance.amendOrder(
    orderId,
    amendOrderRequest
);

Parameters

NameTypeDescriptionNotes
amendOrderRequestAmendOrderRequest
orderId[string]Order IDdefaults to undefined

Return type

AmendOrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order amended successfully-
400Bad request - invalid input-
401Unauthorized - authentication required-
404Resource not found-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

batchCancelOrders

BatchCancelOrdersResponse batchCancelOrders(batchCancelOrdersRequest)
Cancel multiple orders in a single request

Example

import {
    PortfolioApi,
    Configuration,
    BatchCancelOrdersRequest
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let batchCancelOrdersRequest: BatchCancelOrdersRequest; //

const { status, data } = await apiInstance.batchCancelOrders(
    batchCancelOrdersRequest
);

Parameters

NameTypeDescriptionNotes
batchCancelOrdersRequestBatchCancelOrdersRequest

Return type

BatchCancelOrdersResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Batch order cancellation completed-
400Bad request - invalid input-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

batchCreateOrders

BatchCreateOrdersResponse batchCreateOrders(batchCreateOrdersRequest)
Create multiple orders in a single request

Example

import {
    PortfolioApi,
    Configuration,
    BatchCreateOrdersRequest
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let batchCreateOrdersRequest: BatchCreateOrdersRequest; //

const { status, data } = await apiInstance.batchCreateOrders(
    batchCreateOrdersRequest
);

Parameters

NameTypeDescriptionNotes
batchCreateOrdersRequestBatchCreateOrdersRequest

Return type

BatchCreateOrdersResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Batch order creation completed-
400Bad request - invalid input-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

cancelOrder

CancelOrderResponse cancelOrder()
Cancel an order

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let orderId: string; //Order ID (default to undefined)

const { status, data } = await apiInstance.cancelOrder(
    orderId
);

Parameters

NameTypeDescriptionNotes
orderId[string]Order IDdefaults to undefined

Return type

CancelOrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order cancelled successfully-
401Unauthorized - authentication required-
404Resource not found-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

createOrder

CreateOrderResponse createOrder(createOrderRequest)
Create a new order

Example

import {
    PortfolioApi,
    Configuration,
    CreateOrderRequest
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let createOrderRequest: CreateOrderRequest; //

const { status, data } = await apiInstance.createOrder(
    createOrderRequest
);

Parameters

NameTypeDescriptionNotes
createOrderRequestCreateOrderRequest

Return type

CreateOrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
201Order created successfully-
400Bad request - invalid input-
401Unauthorized - authentication required-
429Too Many Requests - rate limit exceeded-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

createOrderGroup

CreateOrderGroupResponse createOrderGroup(createOrderGroupRequest)
Create a new order group

Example

import {
    PortfolioApi,
    Configuration,
    CreateOrderGroupRequest
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let createOrderGroupRequest: CreateOrderGroupRequest; //

const { status, data } = await apiInstance.createOrderGroup(
    createOrderGroupRequest
);

Parameters

NameTypeDescriptionNotes
createOrderGroupRequestCreateOrderGroupRequest

Return type

CreateOrderGroupResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
201Order group created successfully-
400Bad request - invalid input-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

decreaseOrder

DecreaseOrderResponse decreaseOrder(decreaseOrderRequest)
Decrease the size of an existing order

Example

import {
    PortfolioApi,
    Configuration,
    DecreaseOrderRequest
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let orderId: string; //Order ID (default to undefined)
let decreaseOrderRequest: DecreaseOrderRequest; //

const { status, data } = await apiInstance.decreaseOrder(
    orderId,
    decreaseOrderRequest
);

Parameters

NameTypeDescriptionNotes
decreaseOrderRequestDecreaseOrderRequest
orderId[string]Order IDdefaults to undefined

Return type

DecreaseOrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order decreased successfully-
400Bad request - invalid input-
401Unauthorized - authentication required-
404Resource not found-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteOrderGroup

deleteOrderGroup()
Delete an order group

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let orderGroupId: string; //Order group ID (default to undefined)

const { status, data } = await apiInstance.deleteOrderGroup(
    orderGroupId
);

Parameters

NameTypeDescriptionNotes
orderGroupId[string]Order group IDdefaults to undefined

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
204Order group deleted successfully-
401Unauthorized - authentication required-
404Resource not found-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getBalance

GetBalanceResponse getBalance()
Get the user’s current balance

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

const { status, data } = await apiInstance.getBalance();

Parameters

This endpoint does not have any parameters.

Return type

GetBalanceResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Balance retrieved successfully-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getFills

GetFillsResponse getFills()
Get fills for the logged-in user. A fill represents a partial or complete execution of an order. When an order matches with another order in the orderbook, a fill is created for each side of the trade.

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let ticker: string; //Filter by market ticker (optional) (default to undefined)
let orderId: string; //Filter by order ID (optional) (default to undefined)
let minTs: number; //Filter items after this Unix timestamp (optional) (default to undefined)
let maxTs: number; //Filter items before this Unix timestamp (optional) (default to undefined)
let limit: number; //Number of results per page. Defaults to 100. Maximum value is 200. (optional) (default to 100)
let 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) (default to undefined)

const { status, data } = await apiInstance.getFills(
    ticker,
    orderId,
    minTs,
    maxTs,
    limit,
    cursor
);

Parameters

NameTypeDescriptionNotes
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

Return type

GetFillsResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Fills retrieved successfully-
400Bad request - invalid input-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getOrder

GetOrderResponse getOrder()
Get a single order by ID

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let orderId: string; //Order ID (default to undefined)

const { status, data } = await apiInstance.getOrder(
    orderId
);

Parameters

NameTypeDescriptionNotes
orderId[string]Order IDdefaults to undefined

Return type

GetOrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order retrieved successfully-
401Unauthorized - authentication required-
404Resource not found-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getOrderGroups

GetOrderGroupsResponse getOrderGroups()
Get order groups for the logged-in user

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let status: string; //Filter by status. Possible values depend on the endpoint. (optional) (default to undefined)
let limit: number; //Number of results per page. Defaults to 100. Maximum value is 200. (optional) (default to 100)
let 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) (default to undefined)

const { status, data } = await apiInstance.getOrderGroups(
    status,
    limit,
    cursor
);

Parameters

NameTypeDescriptionNotes
status[string]Filter by status. Possible values depend on the endpoint.(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

Return type

GetOrderGroupsResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order groups retrieved successfully-
400Bad request - invalid input-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getOrderQueuePosition

GetOrderQueuePositionResponse getOrderQueuePosition()
Get the queue position for an order

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let orderId: string; //Order ID (default to undefined)

const { status, data } = await apiInstance.getOrderQueuePosition(
    orderId
);

Parameters

NameTypeDescriptionNotes
orderId[string]Order IDdefaults to undefined

Return type

GetOrderQueuePositionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Queue position retrieved successfully-
401Unauthorized - authentication required-
404Resource not found-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getOrders

GetOrdersResponse getOrders()
Get orders for the logged-in user

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let ticker: string; //Filter by market ticker (optional) (default to undefined)
let eventTicker: string; //Filter by event ticker (optional) (default to undefined)
let minTs: number; //Filter items after this Unix timestamp (optional) (default to undefined)
let maxTs: number; //Filter items before this Unix timestamp (optional) (default to undefined)
let status: string; //Filter by status. Possible values depend on the endpoint. (optional) (default to undefined)
let limit: number; //Number of results per page. Defaults to 100. Maximum value is 200. (optional) (default to 100)
let 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) (default to undefined)

const { status, data } = await apiInstance.getOrders(
    ticker,
    eventTicker,
    minTs,
    maxTs,
    status,
    limit,
    cursor
);

Parameters

NameTypeDescriptionNotes
ticker[string]Filter by market ticker(optional) defaults to undefined
eventTicker[string]Filter by event ticker(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
status[string]Filter by status. Possible values depend on the endpoint.(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

Return type

GetOrdersResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Orders retrieved successfully-
400Bad request - invalid input-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getPositions

GetPositionsResponse getPositions()
Get positions for the logged-in user

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let ticker: string; //Filter by market ticker (optional) (default to undefined)
let eventTicker: string; //Filter by event ticker (optional) (default to undefined)
let countDown: number; //Filter positions by minimum count down value (optional) (default to undefined)
let countUp: number; //Filter positions by minimum count up value (optional) (default to undefined)
let limit: number; //Number of results per page. Defaults to 100. Maximum value is 200. (optional) (default to 100)
let 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) (default to undefined)

const { status, data } = await apiInstance.getPositions(
    ticker,
    eventTicker,
    countDown,
    countUp,
    limit,
    cursor
);

Parameters

NameTypeDescriptionNotes
ticker[string]Filter by market ticker(optional) defaults to undefined
eventTicker[string]Filter by event ticker(optional) defaults to undefined
countDown[number]Filter positions by minimum count down value(optional) defaults to undefined
countUp[number]Filter positions by minimum count up value(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

Return type

GetPositionsResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Positions retrieved successfully-
400Bad request - invalid input-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getQueuePositions

GetQueuePositionsResponse getQueuePositions(getQueuePositionsRequest)
Get queue positions for multiple orders

Example

import {
    PortfolioApi,
    Configuration,
    GetQueuePositionsRequest
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let getQueuePositionsRequest: GetQueuePositionsRequest; //

const { status, data } = await apiInstance.getQueuePositions(
    getQueuePositionsRequest
);

Parameters

NameTypeDescriptionNotes
getQueuePositionsRequestGetQueuePositionsRequest

Return type

GetQueuePositionsResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Queue positions retrieved successfully-
400Bad request - invalid input-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSettlements

GetSettlementsResponse getSettlements()
Get settlements for the logged-in user

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let limit: number; //Number of results per page. Defaults to 100. Maximum value is 200. (optional) (default to 100)
let 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) (default to undefined)

const { status, data } = await apiInstance.getSettlements(
    limit,
    cursor
);

Parameters

NameTypeDescriptionNotes
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

GetSettlementsResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Settlements retrieved successfully-
400Bad request - invalid input-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getTotalRestingOrderValue

GetTotalRestingOrderValueResponse getTotalRestingOrderValue()
Get the total value of all resting orders

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

const { status, data } = await apiInstance.getTotalRestingOrderValue();

Parameters

This endpoint does not have any parameters.

Return type

GetTotalRestingOrderValueResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Total resting order value retrieved successfully-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

resetOrderGroup

resetOrderGroup()
Reset an order group

Example

import {
    PortfolioApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new PortfolioApi(configuration);

let orderGroupId: string; //Order group ID (default to undefined)

const { status, data } = await apiInstance.resetOrderGroup(
    orderGroupId
);

Parameters

NameTypeDescriptionNotes
orderGroupId[string]Order group IDdefaults to undefined

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
204Order group reset successfully-
401Unauthorized - authentication required-
404Resource not found-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]