> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://partner.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://partner.ninjatrader.com/_mcp/server.

# Dry Run

POST https://live.tradovateapi.com/v1/order/dryrun
Content-Type: application/json

### Validate an order without placing it.

**Available to:** All authenticated users

**Environments:** Demo, Live

**[Rate Limit](/overview/core-concepts/rate-limits):** 500 requests per hour, 1-second back-off, counts all requests

Submit one or more orders (up to four) for validation against the account's pre-trade risk settings without actually placing them. The response includes a `rejectReason` if the batch would be rejected, so you can surface issues to the trader before they submit a real order.

Use this to check whether an order would pass margin requirements, position limits, and other risk checks before committing to a live trade.

The optional `extraPreTradeRisk` field lets you apply additional risk constraints beyond the account's default settings during validation.

**Common Failure Scenarios**

- The account does not exist (returns `HTTP 404`)
- The caller doesn't have access to the account (returns `HTTP 401`)
- The request contains more than four orders
- Invalid `contractId` in one or more orders

Reference: https://partner.ninjatrader.com/eval/api/rest-api-endpoints/orders/dry-run

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: eval
  version: 1.0.0
paths:
  /order/dryrun:
    post:
      operationId: dry-run
      summary: Dry Run
      description: >-
        ### Validate an order without placing it.


        **Available to:** All authenticated users


        **Environments:** Demo, Live


        **[Rate Limit](/overview/core-concepts/rate-limits):** 500 requests per
        hour, 1-second back-off, counts all requests


        Submit one or more orders (up to four) for validation against the
        account's pre-trade risk settings without actually placing them. The
        response includes a `rejectReason` if the batch would be rejected, so
        you can surface issues to the trader before they submit a real order.


        Use this to check whether an order would pass margin requirements,
        position limits, and other risk checks before committing to a live
        trade.


        The optional `extraPreTradeRisk` field lets you apply additional risk
        constraints beyond the account's default settings during validation.


        **Common Failure Scenarios**


        - The account does not exist (returns `HTTP 404`)

        - The caller doesn't have access to the account (returns `HTTP 401`)

        - The request contains more than four orders

        - Invalid `contractId` in one or more orders
      tags:
        - subpackage_orders
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: DryRunResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DryRunResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DryRun'
servers:
  - url: https://live.tradovateapi.com/v1
    description: https://live.tradovateapi.com/v1
components:
  schemas:
    DryRunOrderAction:
      type: string
      enum:
        - Buy
        - Sell
      description: Buy, Sell
      title: DryRunOrderAction
    DryRunOrderOrderType:
      type: string
      enum:
        - Limit
        - LimitIfTouched
        - MIT
        - Market
        - MarketLimit
        - MarketStopWithProtection
        - MarketWithProtection
        - QTS
        - Stop
        - StopLimit
        - TrailingStop
        - TrailingStopLimit
      description: >-
        Limit, LimitIfTouched, MIT, Market, MarketLimit,
        MarketStopWithProtection, MarketWithProtection, QTS, Stop, StopLimit,
        TrailingStop, TrailingStopLimit
      title: DryRunOrderOrderType
    DryRunOrder:
      type: object
      properties:
        contractId:
          type: integer
          format: int64
        action:
          $ref: '#/components/schemas/DryRunOrderAction'
          description: Buy, Sell
        orderQty:
          type: integer
        orderType:
          $ref: '#/components/schemas/DryRunOrderOrderType'
          description: >-
            Limit, LimitIfTouched, MIT, Market, MarketLimit,
            MarketStopWithProtection, MarketWithProtection, QTS, Stop,
            StopLimit, TrailingStop, TrailingStopLimit
        price:
          type: number
          format: double
        stopPrice:
          type: number
          format: double
      required:
        - contractId
        - action
        - orderQty
        - orderType
      title: DryRunOrder
    ExtraPreTradeRiskProducts:
      type: object
      properties: {}
      title: ExtraPreTradeRiskProducts
    ExtraPreTradeRiskContracts:
      type: object
      properties: {}
      title: ExtraPreTradeRiskContracts
    ExtraPreTradeRisk:
      type: object
      properties:
        maxExposedTotal:
          type: integer
        maxTradedVolumeTotal:
          type: integer
        products:
          $ref: '#/components/schemas/ExtraPreTradeRiskProducts'
        contracts:
          $ref: '#/components/schemas/ExtraPreTradeRiskContracts'
      required:
        - products
        - contracts
      title: ExtraPreTradeRisk
    DryRun:
      type: object
      properties:
        accountId:
          type: integer
          format: int64
        orders:
          type: array
          items:
            $ref: '#/components/schemas/DryRunOrder'
        extraPreTradeRisk:
          $ref: '#/components/schemas/ExtraPreTradeRisk'
      required:
        - accountId
        - orders
      title: DryRun
    DryRunResponseRejectReason:
      type: string
      enum:
        - AccountClosed
        - AdvancedTrailingStopUnsupported
        - AnotherCommandPending
        - BackMonthProhibited
        - ExecutionProviderNotConfigured
        - ExecutionProviderUnavailable
        - InvalidContract
        - InvalidPrice
        - KeyInformationDocumentRequired
        - LiquidationOnly
        - LiquidationOnlyBeforeExpiration
        - MaxOrderQtyIsNotSpecified
        - MaxOrderQtyLimitReached
        - MaxPosLimitMisconfigured
        - MaxPosLimitReached
        - MaxTotalPosLimitReached
        - MultipleAccountPlanRequired
        - NoQuote
        - NotEnoughLiquidity
        - OtherExecutionRelated
        - ParentRejected
        - RiskCheckTimeout
        - SSFNFAComplianceRequired
        - SSFNFAComplianceRequiredJointOnly
        - SSFRiskDisclosureAcknowledgmentRequired
        - SessionClosed
        - Success
        - TooLate
        - TradingLocked
        - TrailingStopNonOrderQtyModify
        - Unauthorized
        - UnknownReason
        - Unsupported
      description: >-
        AccountClosed, AdvancedTrailingStopUnsupported, AnotherCommandPending,
        BackMonthProhibited, ExecutionProviderNotConfigured,
        ExecutionProviderUnavailable, InvalidContract, InvalidPrice,
        KeyInformationDocumentRequired, LiquidationOnly,
        LiquidationOnlyBeforeExpiration, MaxOrderQtyIsNotSpecified,
        MaxOrderQtyLimitReached, MaxPosLimitMisconfigured, MaxPosLimitReached,
        MaxTotalPosLimitReached, MultipleAccountPlanRequired, NoQuote,
        NotEnoughLiquidity, OtherExecutionRelated, ParentRejected,
        RiskCheckTimeout, SSFNFAComplianceRequired,
        SSFNFAComplianceRequiredJointOnly,
        SSFRiskDisclosureAcknowledgmentRequired, SessionClosed, Success,
        TooLate, TradingLocked, TrailingStopNonOrderQtyModify, Unauthorized,
        UnknownReason, Unsupported
      title: DryRunResponseRejectReason
    RiskEvaluationDetails:
      type: object
      properties:
        beforeInitialMarginReq:
          type: number
          format: double
        beforeInitialFullMarginReq:
          type: number
          format: double
        beforeOpenCollateralReq:
          type: number
          format: double
        beforeNetPos:
          type: integer
        isExitOrder:
          type: boolean
        initialMarginReq:
          type: number
          format: double
        initialFullMarginReq:
          type: number
          format: double
        openCollateralReq:
          type: number
          format: double
        totalCash:
          type: number
          format: double
        futuresOpenPnL:
          type: number
          format: double
        optionsOpenPnL:
          type: number
          format: double
        riskCredit:
          type: number
          format: double
        netLiqValue:
          type: number
          format: double
        futureCommAndFees:
          type: number
          format: double
        totalCashRequired:
          type: number
          format: double
        excess:
          type: number
          format: double
        hypoLongPos:
          type: integer
        hypoShortPos:
          type: integer
      required:
        - beforeInitialMarginReq
        - beforeInitialFullMarginReq
        - beforeOpenCollateralReq
        - beforeNetPos
        - isExitOrder
        - initialMarginReq
        - initialFullMarginReq
        - openCollateralReq
        - totalCash
        - futuresOpenPnL
        - optionsOpenPnL
        - riskCredit
        - netLiqValue
        - futureCommAndFees
        - totalCashRequired
        - excess
        - hypoLongPos
        - hypoShortPos
      title: RiskEvaluationDetails
    EstimatedFillFee:
      type: object
      properties:
        clearingFee:
          type: number
          format: double
        clearingCurrencyId:
          type: integer
          format: int64
        exchangeFee:
          type: number
          format: double
        exchangeCurrencyId:
          type: integer
          format: int64
        nfaFee:
          type: number
          format: double
        nfaCurrencyId:
          type: integer
          format: int64
        brokerageFee:
          type: number
          format: double
        brokerageCurrencyId:
          type: integer
          format: int64
        ipFee:
          type: number
          format: double
          description: IP/TT Fee
        ipCurrencyId:
          type: integer
          format: int64
        commission:
          type: number
          format: double
        commissionCurrencyId:
          type: integer
          format: int64
        orderRoutingFee:
          type: number
          format: double
        orderRoutingCurrencyId:
          type: integer
          format: int64
        commissionNotionalValueBPS:
          type: number
          format: double
        exchangeFeeNotionalValueBPS:
          type: number
          format: double
      title: EstimatedFillFee
    DryRunResponse:
      type: object
      properties:
        errorText:
          type: string
          description: Non-empty if the request failed
        rejectReason:
          $ref: '#/components/schemas/DryRunResponseRejectReason'
          description: >-
            AccountClosed, AdvancedTrailingStopUnsupported,
            AnotherCommandPending, BackMonthProhibited,
            ExecutionProviderNotConfigured, ExecutionProviderUnavailable,
            InvalidContract, InvalidPrice, KeyInformationDocumentRequired,
            LiquidationOnly, LiquidationOnlyBeforeExpiration,
            MaxOrderQtyIsNotSpecified, MaxOrderQtyLimitReached,
            MaxPosLimitMisconfigured, MaxPosLimitReached,
            MaxTotalPosLimitReached, MultipleAccountPlanRequired, NoQuote,
            NotEnoughLiquidity, OtherExecutionRelated, ParentRejected,
            RiskCheckTimeout, SSFNFAComplianceRequired,
            SSFNFAComplianceRequiredJointOnly,
            SSFRiskDisclosureAcknowledgmentRequired, SessionClosed, Success,
            TooLate, TradingLocked, TrailingStopNonOrderQtyModify, Unauthorized,
            UnknownReason, Unsupported
        comment:
          type: string
        details:
          $ref: '#/components/schemas/RiskEvaluationDetails'
        fees:
          $ref: '#/components/schemas/EstimatedFillFee'
      title: DryRunResponse
  securitySchemes:
    bearer_access_token:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{
  "accountId": 1,
  "orders": [
    {
      "contractId": 1,
      "action": "Buy",
      "orderQty": 1,
      "orderType": "Limit"
    }
  ]
}
```

**Response**

```json
{
  "errorText": "string",
  "rejectReason": "AccountClosed",
  "comment": "string",
  "details": {
    "beforeInitialMarginReq": 1.1,
    "beforeInitialFullMarginReq": 1.1,
    "beforeOpenCollateralReq": 1.1,
    "beforeNetPos": 1,
    "isExitOrder": true,
    "initialMarginReq": 1.1,
    "initialFullMarginReq": 1.1,
    "openCollateralReq": 1.1,
    "totalCash": 1.1,
    "futuresOpenPnL": 1.1,
    "optionsOpenPnL": 1.1,
    "riskCredit": 1.1,
    "netLiqValue": 1.1,
    "futureCommAndFees": 1.1,
    "totalCashRequired": 1.1,
    "excess": 1.1,
    "hypoLongPos": 1,
    "hypoShortPos": 1
  },
  "fees": {
    "clearingFee": 1.1,
    "clearingCurrencyId": 1,
    "exchangeFee": 1.1,
    "exchangeCurrencyId": 1,
    "nfaFee": 1.1,
    "nfaCurrencyId": 1,
    "brokerageFee": 1.1,
    "brokerageCurrencyId": 1,
    "ipFee": 1.1,
    "ipCurrencyId": 1,
    "commission": 1.1,
    "commissionCurrencyId": 1,
    "orderRoutingFee": 1.1,
    "orderRoutingCurrencyId": 1,
    "commissionNotionalValueBPS": 1.1,
    "exchangeFeeNotionalValueBPS": 1.1
  }
}
```

**SDK Code**

```python
import requests

url = "https://live.tradovateapi.com/v1/order/dryrun"

payload = {
    "accountId": 1,
    "orders": [
        {
            "contractId": 1,
            "action": "Buy",
            "orderQty": 1,
            "orderType": "Limit"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://live.tradovateapi.com/v1/order/dryrun';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"accountId":1,"orders":[{"contractId":1,"action":"Buy","orderQty":1,"orderType":"Limit"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://live.tradovateapi.com/v1/order/dryrun"

	payload := strings.NewReader("{\n  \"accountId\": 1,\n  \"orders\": [\n    {\n      \"contractId\": 1,\n      \"action\": \"Buy\",\n      \"orderQty\": 1,\n      \"orderType\": \"Limit\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://live.tradovateapi.com/v1/order/dryrun")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"accountId\": 1,\n  \"orders\": [\n    {\n      \"contractId\": 1,\n      \"action\": \"Buy\",\n      \"orderQty\": 1,\n      \"orderType\": \"Limit\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://live.tradovateapi.com/v1/order/dryrun")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"accountId\": 1,\n  \"orders\": [\n    {\n      \"contractId\": 1,\n      \"action\": \"Buy\",\n      \"orderQty\": 1,\n      \"orderType\": \"Limit\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://live.tradovateapi.com/v1/order/dryrun', [
  'body' => '{
  "accountId": 1,
  "orders": [
    {
      "contractId": 1,
      "action": "Buy",
      "orderQty": 1,
      "orderType": "Limit"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://live.tradovateapi.com/v1/order/dryrun");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"accountId\": 1,\n  \"orders\": [\n    {\n      \"contractId\": 1,\n      \"action\": \"Buy\",\n      \"orderQty\": 1,\n      \"orderType\": \"Limit\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "accountId": 1,
  "orders": [
    [
      "contractId": 1,
      "action": "Buy",
      "orderQty": 1,
      "orderType": "Limit"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://live.tradovateapi.com/v1/order/dryrun")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```