Class OrdersApi
java.lang.Object
markets.alpaca.client.openapi.trading.api.OrdersApi
Generated client for OrdersApi operations.
This class is generated from the configured OpenAPI spec. Operation method Javadocs include OAS summaries, descriptions, parameters, return types, response details, and external documentation links when present in the spec.
Operations
deleteAllOrders: Delete All OrdersdeleteOrderByOrderID: Delete Order by IDgetAllOrders: Get All OrdersgetOrderByClientOrderId: Get Order by Client Order IDgetOrderByOrderID: Get Order by IDpatchOrderByOrderId: Replace Order by IDpostOrder: Create an Order
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDelete All Orders Attempts to cancel all open orders.okhttp3.CalldeleteAllOrdersAsync(ApiCallback<List<CanceledOrderResponse>> _callback) Delete All Orders (asynchronously) Attempts to cancel all open orders.okhttp3.CalldeleteAllOrdersCall(ApiCallback _callback) Build call for deleteAllOrdersDelete All Orders Attempts to cancel all open orders.voiddeleteOrderByOrderID(UUID orderId) Delete Order by ID Attempts to cancel an Open Order.okhttp3.CalldeleteOrderByOrderIDAsync(UUID orderId, ApiCallback<Void> _callback) Delete Order by ID (asynchronously) Attempts to cancel an Open Order.okhttp3.CalldeleteOrderByOrderIDCall(UUID orderId, ApiCallback _callback) Build call for deleteOrderByOrderIDdeleteOrderByOrderIDWithHttpInfo(UUID orderId) Delete Order by ID Attempts to cancel an Open Order.getAllOrders(String status, Integer limit, String after, String until, String direction, Boolean nested, String symbols, String side, List<String> assetClass, String beforeOrderId, String afterOrderId) Get All Orders Retrieves a list of orders for the account, filtered by the supplied query parameters.okhttp3.CallgetAllOrdersAsync(String status, Integer limit, String after, String until, String direction, Boolean nested, String symbols, String side, List<String> assetClass, String beforeOrderId, String afterOrderId, ApiCallback<List<Order>> _callback) Get All Orders (asynchronously) Retrieves a list of orders for the account, filtered by the supplied query parameters.okhttp3.CallgetAllOrdersCall(String status, Integer limit, String after, String until, String direction, Boolean nested, String symbols, String side, List<String> assetClass, String beforeOrderId, String afterOrderId, ApiCallback _callback) Build call for getAllOrdersgetAllOrdersWithHttpInfo(String status, Integer limit, String after, String until, String direction, Boolean nested, String symbols, String side, List<String> assetClass, String beforeOrderId, String afterOrderId) Get All Orders Retrieves a list of orders for the account, filtered by the supplied query parameters.intgetOrderByClientOrderId(String clientOrderId) Get Order by Client Order ID Retrieves a single order specified by the client order ID.okhttp3.CallgetOrderByClientOrderIdAsync(String clientOrderId, ApiCallback<Order> _callback) Get Order by Client Order ID (asynchronously) Retrieves a single order specified by the client order ID.okhttp3.CallgetOrderByClientOrderIdCall(String clientOrderId, ApiCallback _callback) Build call for getOrderByClientOrderIdgetOrderByClientOrderIdWithHttpInfo(String clientOrderId) Get Order by Client Order ID Retrieves a single order specified by the client order ID.getOrderByOrderID(UUID orderId, Boolean nested) Get Order by ID Retrieves a single order for the given order_id.okhttp3.CallgetOrderByOrderIDAsync(UUID orderId, Boolean nested, ApiCallback<Order> _callback) Get Order by ID (asynchronously) Retrieves a single order for the given order_id.okhttp3.CallgetOrderByOrderIDCall(UUID orderId, Boolean nested, ApiCallback _callback) Build call for getOrderByOrderIDgetOrderByOrderIDWithHttpInfo(UUID orderId, Boolean nested) Get Order by ID Retrieves a single order for the given order_id.patchOrderByOrderId(UUID orderId, PatchOrderRequest patchOrderRequest) Replace Order by ID Replaces a single order with updated parameters.okhttp3.CallpatchOrderByOrderIdAsync(UUID orderId, PatchOrderRequest patchOrderRequest, ApiCallback<Order> _callback) Replace Order by ID (asynchronously) Replaces a single order with updated parameters.okhttp3.CallpatchOrderByOrderIdCall(UUID orderId, PatchOrderRequest patchOrderRequest, ApiCallback _callback) Build call for patchOrderByOrderIdpatchOrderByOrderIdWithHttpInfo(UUID orderId, PatchOrderRequest patchOrderRequest) Replace Order by ID Replaces a single order with updated parameters.postOrder(PostOrderRequest postOrderRequest) Create an Order Places a new order for the given account.okhttp3.CallpostOrderAsync(PostOrderRequest postOrderRequest, ApiCallback<Order> _callback) Create an Order (asynchronously) Places a new order for the given account.okhttp3.CallpostOrderCall(PostOrderRequest postOrderRequest, ApiCallback _callback) Build call for postOrderpostOrderWithHttpInfo(PostOrderRequest postOrderRequest) Create an Order Places a new order for the given account.voidsetApiClient(ApiClient apiClient) voidsetCustomBaseUrl(String customBaseUrl) voidsetHostIndex(int hostIndex)
-
Constructor Details
-
OrdersApi
public OrdersApi() -
OrdersApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
getHostIndex
public int getHostIndex() -
setHostIndex
public void setHostIndex(int hostIndex) -
getCustomBaseUrl
-
setCustomBaseUrl
-
deleteAllOrdersCall
Build call for deleteAllOrders- Parameters:
_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 207 Multi-Status with body. an array of objects that include the order id and http status code for each status request. - 500 Failed to cancel order. -
-
deleteAllOrders
Delete All Orders Attempts to cancel all open orders. A response will be provided for each order that is attempted to be cancelled. If an order is no longer cancelable, the server will respond with status 500 and reject the request.- Returns:
- List<CanceledOrderResponse>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 207 Multi-Status with body. an array of objects that include the order id and http status code for each status request. - 500 Failed to cancel order. -
-
deleteAllOrdersWithHttpInfo
Delete All Orders Attempts to cancel all open orders. A response will be provided for each order that is attempted to be cancelled. If an order is no longer cancelable, the server will respond with status 500 and reject the request.- Returns:
- ApiResponse<List<CanceledOrderResponse>>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 207 Multi-Status with body. an array of objects that include the order id and http status code for each status request. - 500 Failed to cancel order. -
-
deleteAllOrdersAsync
public okhttp3.Call deleteAllOrdersAsync(ApiCallback<List<CanceledOrderResponse>> _callback) throws ApiException Delete All Orders (asynchronously) Attempts to cancel all open orders. A response will be provided for each order that is attempted to be cancelled. If an order is no longer cancelable, the server will respond with status 500 and reject the request.- Parameters:
_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 207 Multi-Status with body. an array of objects that include the order id and http status code for each status request. - 500 Failed to cancel order. -
-
deleteOrderByOrderIDCall
public okhttp3.Call deleteOrderByOrderIDCall(@Nonnull UUID orderId, ApiCallback _callback) throws ApiException Build call for deleteOrderByOrderID- Parameters:
orderId- order id (required)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 204 No Content - 422 The order status is not cancelable. -
-
deleteOrderByOrderID
Delete Order by ID Attempts to cancel an Open Order. If the order is no longer cancelable, the request will be rejected with status 422; otherwise accepted with return status 204.- Parameters:
orderId- order id (required)- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 204 No Content - 422 The order status is not cancelable. -
-
deleteOrderByOrderIDWithHttpInfo
public ApiResponse<Void> deleteOrderByOrderIDWithHttpInfo(@Nonnull UUID orderId) throws ApiException Delete Order by ID Attempts to cancel an Open Order. If the order is no longer cancelable, the request will be rejected with status 422; otherwise accepted with return status 204.- Parameters:
orderId- order id (required)- Returns:
- ApiResponse<Void>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 204 No Content - 422 The order status is not cancelable. -
-
deleteOrderByOrderIDAsync
public okhttp3.Call deleteOrderByOrderIDAsync(@Nonnull UUID orderId, ApiCallback<Void> _callback) throws ApiException Delete Order by ID (asynchronously) Attempts to cancel an Open Order. If the order is no longer cancelable, the request will be rejected with status 422; otherwise accepted with return status 204.- Parameters:
orderId- order id (required)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 204 No Content - 422 The order status is not cancelable. -
-
getAllOrdersCall
public okhttp3.Call getAllOrdersCall(@Nullable String status, @Nullable Integer limit, @Nullable String after, @Nullable String until, @Nullable String direction, @Nullable Boolean nested, @Nullable String symbols, @Nullable String side, @Nullable List<String> assetClass, @Nullable String beforeOrderId, @Nullable String afterOrderId, ApiCallback _callback) throws ApiException Build call for getAllOrders- Parameters:
status- Order status to be queried. open, closed or all. Defaults to open. (optional)limit- The maximum number of orders in response. Defaults to 50 and max is 500. (optional)after- The response will include only ones submitted after this timestamp (exclusive.) (optional)until- The response will include only ones submitted until this timestamp (exclusive.) (optional)direction- The chronological order of response based on the submission time. asc or desc. Defaults to desc. (optional)nested- If true, the result will roll up multi-leg orders under the legs field of primary order. (optional)symbols- A comma-separated list of symbols to filter by (ex. \"AAPL,TSLA,MSFT\"). A currency pair is required for crypto orders (ex. \"BTCUSD,BCHUSD,LTCUSD,ETCUSD\"). (optional)side- Filters down to orders that have a matching side field set. (optional)assetClass- A comma-separated list of asset classes, the response will include only orders in the specified asset classes. By specifying `us_option` as the class, you can query option orders by underlying symbol using the symbols parameter. (optional)beforeOrderId- Return orders submitted before the order with this ID (exclusive). Mutually exclusive with `after_order_id`. Do not combine with `after`/`until`. (optional)afterOrderId- Return orders submitted after the order with this ID (exclusive). Mutually exclusive with `before_order_id`. Do not combine with `after`/`until`. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response An array of Order objects -
-
getAllOrders
public List<Order> getAllOrders(@Nullable String status, @Nullable Integer limit, @Nullable String after, @Nullable String until, @Nullable String direction, @Nullable Boolean nested, @Nullable String symbols, @Nullable String side, @Nullable List<String> assetClass, @Nullable String beforeOrderId, @Nullable String afterOrderId) throws ApiException Get All Orders Retrieves a list of orders for the account, filtered by the supplied query parameters.- Parameters:
status- Order status to be queried. open, closed or all. Defaults to open. (optional)limit- The maximum number of orders in response. Defaults to 50 and max is 500. (optional)after- The response will include only ones submitted after this timestamp (exclusive.) (optional)until- The response will include only ones submitted until this timestamp (exclusive.) (optional)direction- The chronological order of response based on the submission time. asc or desc. Defaults to desc. (optional)nested- If true, the result will roll up multi-leg orders under the legs field of primary order. (optional)symbols- A comma-separated list of symbols to filter by (ex. \"AAPL,TSLA,MSFT\"). A currency pair is required for crypto orders (ex. \"BTCUSD,BCHUSD,LTCUSD,ETCUSD\"). (optional)side- Filters down to orders that have a matching side field set. (optional)assetClass- A comma-separated list of asset classes, the response will include only orders in the specified asset classes. By specifying `us_option` as the class, you can query option orders by underlying symbol using the symbols parameter. (optional)beforeOrderId- Return orders submitted before the order with this ID (exclusive). Mutually exclusive with `after_order_id`. Do not combine with `after`/`until`. (optional)afterOrderId- Return orders submitted after the order with this ID (exclusive). Mutually exclusive with `before_order_id`. Do not combine with `after`/`until`. (optional)- Returns:
- List<Order>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response An array of Order objects -
-
getAllOrdersWithHttpInfo
public ApiResponse<List<Order>> getAllOrdersWithHttpInfo(@Nullable String status, @Nullable Integer limit, @Nullable String after, @Nullable String until, @Nullable String direction, @Nullable Boolean nested, @Nullable String symbols, @Nullable String side, @Nullable List<String> assetClass, @Nullable String beforeOrderId, @Nullable String afterOrderId) throws ApiException Get All Orders Retrieves a list of orders for the account, filtered by the supplied query parameters.- Parameters:
status- Order status to be queried. open, closed or all. Defaults to open. (optional)limit- The maximum number of orders in response. Defaults to 50 and max is 500. (optional)after- The response will include only ones submitted after this timestamp (exclusive.) (optional)until- The response will include only ones submitted until this timestamp (exclusive.) (optional)direction- The chronological order of response based on the submission time. asc or desc. Defaults to desc. (optional)nested- If true, the result will roll up multi-leg orders under the legs field of primary order. (optional)symbols- A comma-separated list of symbols to filter by (ex. \"AAPL,TSLA,MSFT\"). A currency pair is required for crypto orders (ex. \"BTCUSD,BCHUSD,LTCUSD,ETCUSD\"). (optional)side- Filters down to orders that have a matching side field set. (optional)assetClass- A comma-separated list of asset classes, the response will include only orders in the specified asset classes. By specifying `us_option` as the class, you can query option orders by underlying symbol using the symbols parameter. (optional)beforeOrderId- Return orders submitted before the order with this ID (exclusive). Mutually exclusive with `after_order_id`. Do not combine with `after`/`until`. (optional)afterOrderId- Return orders submitted after the order with this ID (exclusive). Mutually exclusive with `before_order_id`. Do not combine with `after`/`until`. (optional)- Returns:
- ApiResponse<List<Order>>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response An array of Order objects -
-
getAllOrdersAsync
public okhttp3.Call getAllOrdersAsync(@Nullable String status, @Nullable Integer limit, @Nullable String after, @Nullable String until, @Nullable String direction, @Nullable Boolean nested, @Nullable String symbols, @Nullable String side, @Nullable List<String> assetClass, @Nullable String beforeOrderId, @Nullable String afterOrderId, ApiCallback<List<Order>> _callback) throws ApiException Get All Orders (asynchronously) Retrieves a list of orders for the account, filtered by the supplied query parameters.- Parameters:
status- Order status to be queried. open, closed or all. Defaults to open. (optional)limit- The maximum number of orders in response. Defaults to 50 and max is 500. (optional)after- The response will include only ones submitted after this timestamp (exclusive.) (optional)until- The response will include only ones submitted until this timestamp (exclusive.) (optional)direction- The chronological order of response based on the submission time. asc or desc. Defaults to desc. (optional)nested- If true, the result will roll up multi-leg orders under the legs field of primary order. (optional)symbols- A comma-separated list of symbols to filter by (ex. \"AAPL,TSLA,MSFT\"). A currency pair is required for crypto orders (ex. \"BTCUSD,BCHUSD,LTCUSD,ETCUSD\"). (optional)side- Filters down to orders that have a matching side field set. (optional)assetClass- A comma-separated list of asset classes, the response will include only orders in the specified asset classes. By specifying `us_option` as the class, you can query option orders by underlying symbol using the symbols parameter. (optional)beforeOrderId- Return orders submitted before the order with this ID (exclusive). Mutually exclusive with `after_order_id`. Do not combine with `after`/`until`. (optional)afterOrderId- Return orders submitted after the order with this ID (exclusive). Mutually exclusive with `before_order_id`. Do not combine with `after`/`until`. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response An array of Order objects -
-
getOrderByClientOrderIdCall
public okhttp3.Call getOrderByClientOrderIdCall(@Nonnull String clientOrderId, ApiCallback _callback) throws ApiException Build call for getOrderByClientOrderId- Parameters:
clientOrderId- The client-assigned order ID. (required)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successfully retrieved the order matching the client_order_id. -
-
getOrderByClientOrderId
Get Order by Client Order ID Retrieves a single order specified by the client order ID.- Parameters:
clientOrderId- The client-assigned order ID. (required)- Returns:
- Order
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successfully retrieved the order matching the client_order_id. -
-
getOrderByClientOrderIdWithHttpInfo
public ApiResponse<Order> getOrderByClientOrderIdWithHttpInfo(@Nonnull String clientOrderId) throws ApiException Get Order by Client Order ID Retrieves a single order specified by the client order ID.- Parameters:
clientOrderId- The client-assigned order ID. (required)- Returns:
- ApiResponse<Order>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successfully retrieved the order matching the client_order_id. -
-
getOrderByClientOrderIdAsync
public okhttp3.Call getOrderByClientOrderIdAsync(@Nonnull String clientOrderId, ApiCallback<Order> _callback) throws ApiException Get Order by Client Order ID (asynchronously) Retrieves a single order specified by the client order ID.- Parameters:
clientOrderId- The client-assigned order ID. (required)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successfully retrieved the order matching the client_order_id. -
-
getOrderByOrderIDCall
public okhttp3.Call getOrderByOrderIDCall(@Nonnull UUID orderId, @Nullable Boolean nested, ApiCallback _callback) throws ApiException Build call for getOrderByOrderID- Parameters:
orderId- order id (required)nested- If true, the result will roll up multi-leg orders under the legs field of primary order. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response -
-
getOrderByOrderID
Get Order by ID Retrieves a single order for the given order_id.- Parameters:
orderId- order id (required)nested- If true, the result will roll up multi-leg orders under the legs field of primary order. (optional)- Returns:
- Order
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response -
-
getOrderByOrderIDWithHttpInfo
public ApiResponse<Order> getOrderByOrderIDWithHttpInfo(@Nonnull UUID orderId, @Nullable Boolean nested) throws ApiException Get Order by ID Retrieves a single order for the given order_id.- Parameters:
orderId- order id (required)nested- If true, the result will roll up multi-leg orders under the legs field of primary order. (optional)- Returns:
- ApiResponse<Order>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response -
-
getOrderByOrderIDAsync
public okhttp3.Call getOrderByOrderIDAsync(@Nonnull UUID orderId, @Nullable Boolean nested, ApiCallback<Order> _callback) throws ApiException Get Order by ID (asynchronously) Retrieves a single order for the given order_id.- Parameters:
orderId- order id (required)nested- If true, the result will roll up multi-leg orders under the legs field of primary order. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response -
-
patchOrderByOrderIdCall
public okhttp3.Call patchOrderByOrderIdCall(@Nonnull UUID orderId, @Nonnull PatchOrderRequest patchOrderRequest, ApiCallback _callback) throws ApiException Build call for patchOrderByOrderId- Parameters:
orderId- order id (required)patchOrderRequest- (required)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response The new Order object with the new order ID. -
-
patchOrderByOrderId
public Order patchOrderByOrderId(@Nonnull UUID orderId, @Nonnull PatchOrderRequest patchOrderRequest) throws ApiException Replace Order by ID Replaces a single order with updated parameters. Each parameter overrides the corresponding attribute of the existing order. The other attributes remain the same as the existing order. A success return code from a replaced order does NOT guarantee the existing open order has been replaced. If the existing open order is filled before the replacing (new) order reaches the execution venue, the replacing (new) order is rejected, and these events are sent in the trade_updates stream channel. While an order is being replaced, buying power is reduced by the larger of the two orders that have been placed (the old order being replaced, and the newly placed order to replace it). If you are replacing a buy entry order with a higher limit price than the original order, the buying power is calculated based on the newly placed order. If you are replacing it with a lower limit price, the buying power is calculated based on the old order. Note: Order cannot be replaced when the status is `accepted`, `pending_new`, `pending_cancel` or `pending_replace`. Note: Notional orders for non-IPO asset classes cannot be replaced. Any attempt to modify a non-IPO notional order via this endpoint will be rejected; cancel it and submit a new one instead. Note: IPO indications of interest (`asset_class: \"ipo\"`) **are** notional and **can** be replaced via this endpoint by providing a new `notional` value. `qty` and `notional` are mutually exclusive on a single replace request.- Parameters:
orderId- order id (required)patchOrderRequest- (required)- Returns:
- Order
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response The new Order object with the new order ID. -
-
patchOrderByOrderIdWithHttpInfo
public ApiResponse<Order> patchOrderByOrderIdWithHttpInfo(@Nonnull UUID orderId, @Nonnull PatchOrderRequest patchOrderRequest) throws ApiException Replace Order by ID Replaces a single order with updated parameters. Each parameter overrides the corresponding attribute of the existing order. The other attributes remain the same as the existing order. A success return code from a replaced order does NOT guarantee the existing open order has been replaced. If the existing open order is filled before the replacing (new) order reaches the execution venue, the replacing (new) order is rejected, and these events are sent in the trade_updates stream channel. While an order is being replaced, buying power is reduced by the larger of the two orders that have been placed (the old order being replaced, and the newly placed order to replace it). If you are replacing a buy entry order with a higher limit price than the original order, the buying power is calculated based on the newly placed order. If you are replacing it with a lower limit price, the buying power is calculated based on the old order. Note: Order cannot be replaced when the status is `accepted`, `pending_new`, `pending_cancel` or `pending_replace`. Note: Notional orders for non-IPO asset classes cannot be replaced. Any attempt to modify a non-IPO notional order via this endpoint will be rejected; cancel it and submit a new one instead. Note: IPO indications of interest (`asset_class: \"ipo\"`) **are** notional and **can** be replaced via this endpoint by providing a new `notional` value. `qty` and `notional` are mutually exclusive on a single replace request.- Parameters:
orderId- order id (required)patchOrderRequest- (required)- Returns:
- ApiResponse<Order>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response The new Order object with the new order ID. -
-
patchOrderByOrderIdAsync
public okhttp3.Call patchOrderByOrderIdAsync(@Nonnull UUID orderId, @Nonnull PatchOrderRequest patchOrderRequest, ApiCallback<Order> _callback) throws ApiException Replace Order by ID (asynchronously) Replaces a single order with updated parameters. Each parameter overrides the corresponding attribute of the existing order. The other attributes remain the same as the existing order. A success return code from a replaced order does NOT guarantee the existing open order has been replaced. If the existing open order is filled before the replacing (new) order reaches the execution venue, the replacing (new) order is rejected, and these events are sent in the trade_updates stream channel. While an order is being replaced, buying power is reduced by the larger of the two orders that have been placed (the old order being replaced, and the newly placed order to replace it). If you are replacing a buy entry order with a higher limit price than the original order, the buying power is calculated based on the newly placed order. If you are replacing it with a lower limit price, the buying power is calculated based on the old order. Note: Order cannot be replaced when the status is `accepted`, `pending_new`, `pending_cancel` or `pending_replace`. Note: Notional orders for non-IPO asset classes cannot be replaced. Any attempt to modify a non-IPO notional order via this endpoint will be rejected; cancel it and submit a new one instead. Note: IPO indications of interest (`asset_class: \"ipo\"`) **are** notional and **can** be replaced via this endpoint by providing a new `notional` value. `qty` and `notional` are mutually exclusive on a single replace request.- Parameters:
orderId- order id (required)patchOrderRequest- (required)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response The new Order object with the new order ID. -
-
postOrderCall
public okhttp3.Call postOrderCall(@Nonnull PostOrderRequest postOrderRequest, ApiCallback _callback) throws ApiException Build call for postOrder- Parameters:
postOrderRequest- (required)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response - 403 Forbidden Buying power or shares is not sufficient. - 422 Unprocessable Input parameters are not recognized. -
-
postOrder
Create an Order Places a new order for the given account. An order request may be rejected if the account is not authorized for trading, or if the tradable balance is insufficient to fill the order.- Parameters:
postOrderRequest- (required)- Returns:
- Order
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response - 403 Forbidden Buying power or shares is not sufficient. - 422 Unprocessable Input parameters are not recognized. -
-
postOrderWithHttpInfo
public ApiResponse<Order> postOrderWithHttpInfo(@Nonnull PostOrderRequest postOrderRequest) throws ApiException Create an Order Places a new order for the given account. An order request may be rejected if the account is not authorized for trading, or if the tradable balance is insufficient to fill the order.- Parameters:
postOrderRequest- (required)- Returns:
- ApiResponse<Order>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response - 403 Forbidden Buying power or shares is not sufficient. - 422 Unprocessable Input parameters are not recognized. -
-
postOrderAsync
public okhttp3.Call postOrderAsync(@Nonnull PostOrderRequest postOrderRequest, ApiCallback<Order> _callback) throws ApiException Create an Order (asynchronously) Places a new order for the given account. An order request may be rejected if the account is not authorized for trading, or if the tradable balance is insufficient to fill the order.- Parameters:
postOrderRequest- (required)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object- HTTP Response Details:
Response Details Status Code Description Response Headers 200 Successful response - 403 Forbidden Buying power or shares is not sufficient. - 422 Unprocessable Input parameters are not recognized. -
-