> 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.

# Calculate Plan Upgrade

POST https://live.tradovateapi.com/v1/user/calculateplanupgrade
Content-Type: application/json

### Calculate the cost of upgrading to a different subscription plan.

**Available to:** All authenticated users

**Environments:** Live

**[Rate Limit](/overview/core-concepts/rate-limits):** No endpoint-specific limit

Preview what switching the calling user's Tradovate subscription to another plan would cost before committing to the change. This is a read-only calculation — it doesn't modify the subscription or charge anything.

The response returns:

- `estimatedAmount` — the new plan's price minus any prorated refund for the unused portion of the current plan
- `refund` — the prorated credit from the current plan, when one applies
- `current` — the user's current subscription
- `startDate` and `expirationDate` — the period the new plan would cover

**Field Details**

The `tradovateSubscriptionPlanId` identifies the target plan. Use the `/tradovateSubscriptionPlan/list` endpoint to retrieve available plan IDs.

The calculation applies to the authenticated user's own subscription.

**Common Failure Scenarios**

- Target plan doesn't exist or isn't available
- Target plan is the user's current plan
- Target plan is a trial and the user already had one, or has an active live account
- Switch would be a downgrade, which isn't allowed through this flow

**Error Messages**

| `errorText` | Trigger |
|-------------|---------|
| `"Membership plan is not available."` | `tradovateSubscriptionPlanId` doesn't match an available plan |
| `"Switch to the same plan is not allowed. Your membership will be renewed at the end of period"` | Target plan is the current plan (`errorCode: ConflictWithExisting`) |
| `"Gap between subscriptions are not allowed"` | Current subscription expires before the upgrade would start (`errorCode: ConflictWithExisting`) |
| `"Trial with active live account is not allowed"` | Target is a free trial plan and the user has an active live account (`errorCode: SingleTrialOnly`) |
| `"Only one trial is allowed"` | Target is a free trial plan and the user already had a trial (`errorCode: SingleTrialOnly`) |
| `"Cannot downgrade from Lifetime plan"` | Current plan is a lifetime membership (`errorCode: DowngradeNotAllowed`) |
| `"Please contact Customer Service about downgrading the plan"` | New plan's price minus the refund is negative (`errorCode: DowngradeNotAllowed`) |

**Related Endpoints**

- Use [`addTradovateSubscription`](/api/rest-api-endpoints/users/add-tradovate-subscription) to apply a plan change after previewing the cost.

Reference: https://partner.ninjatrader.com/connect/api/rest-api-endpoints/users/calculate-plan-upgrade

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: connect
  version: 1.0.0
paths:
  /user/calculateplanupgrade:
    post:
      operationId: calculate-plan-upgrade
      summary: Calculate Plan Upgrade
      description: >-
        ### Calculate the cost of upgrading to a different subscription plan.


        **Available to:** All authenticated users


        **Environments:** Live


        **[Rate Limit](/overview/core-concepts/rate-limits):** No
        endpoint-specific limit


        Preview what switching the calling user's Tradovate subscription to
        another plan would cost before committing to the change. This is a
        read-only calculation — it doesn't modify the subscription or charge
        anything.


        The response returns:


        - `estimatedAmount` — the new plan's price minus any prorated refund for
        the unused portion of the current plan

        - `refund` — the prorated credit from the current plan, when one applies

        - `current` — the user's current subscription

        - `startDate` and `expirationDate` — the period the new plan would cover


        **Field Details**


        The `tradovateSubscriptionPlanId` identifies the target plan. Use the
        `/tradovateSubscriptionPlan/list` endpoint to retrieve available plan
        IDs.


        The calculation applies to the authenticated user's own subscription.


        **Common Failure Scenarios**


        - Target plan doesn't exist or isn't available

        - Target plan is the user's current plan

        - Target plan is a trial and the user already had one, or has an active
        live account

        - Switch would be a downgrade, which isn't allowed through this flow


        **Error Messages**


        | `errorText` | Trigger |

        |-------------|---------|

        | `"Membership plan is not available."` | `tradovateSubscriptionPlanId`
        doesn't match an available plan |

        | `"Switch to the same plan is not allowed. Your membership will be
        renewed at the end of period"` | Target plan is the current plan
        (`errorCode: ConflictWithExisting`) |

        | `"Gap between subscriptions are not allowed"` | Current subscription
        expires before the upgrade would start (`errorCode:
        ConflictWithExisting`) |

        | `"Trial with active live account is not allowed"` | Target is a free
        trial plan and the user has an active live account (`errorCode:
        SingleTrialOnly`) |

        | `"Only one trial is allowed"` | Target is a free trial plan and the
        user already had a trial (`errorCode: SingleTrialOnly`) |

        | `"Cannot downgrade from Lifetime plan"` | Current plan is a lifetime
        membership (`errorCode: DowngradeNotAllowed`) |

        | `"Please contact Customer Service about downgrading the plan"` | New
        plan's price minus the refund is negative (`errorCode:
        DowngradeNotAllowed`) |


        **Related Endpoints**


        - Use
        [`addTradovateSubscription`](/api/rest-api-endpoints/users/add-tradovate-subscription)
        to apply a plan change after previewing the cost.
      tags:
        - Users
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: PlanUpgradeResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanUpgradeResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CalculatePlanUpgrade'
servers:
  - url: https://live.tradovateapi.com/v1
    description: https://live.tradovateapi.com/v1
components:
  schemas:
    CalculatePlanUpgrade:
      type: object
      properties:
        tradovateSubscriptionPlanId:
          type: integer
          format: int64
      required:
        - tradovateSubscriptionPlanId
      title: CalculatePlanUpgrade
    PlanUpgradeResponseErrorCode:
      type: string
      enum:
        - ConflictWithExisting
        - DowngradeNotAllowed
        - IncompatibleCMEMarketDataSubscriptionPlans
        - IncorrectPaymentMethod
        - InsufficientFunds
        - PaymentProviderError
        - PlanDiscontinued
        - SingleTrialOnly
        - Success
        - UnknownError
      description: >-
        ConflictWithExisting, DowngradeNotAllowed,
        IncompatibleCMEMarketDataSubscriptionPlans, IncorrectPaymentMethod,
        InsufficientFunds, PaymentProviderError, PlanDiscontinued,
        SingleTrialOnly, Success, UnknownError
      title: PlanUpgradeResponseErrorCode
    TradeDate:
      type: object
      properties:
        year:
          type: integer
        month:
          type: integer
        day:
          type: integer
      required:
        - year
        - month
        - day
      title: TradeDate
    TradovateSubscription:
      type: object
      properties:
        id:
          type: integer
          format: int64
        userId:
          type: integer
          format: int64
        timestamp:
          type: string
          format: date-time
        planPrice:
          type: number
          format: double
        cashBalanceLogId:
          type: integer
          format: int64
        accountId:
          type: integer
          format: int64
        tradovateSubscriptionPlanId:
          type: integer
          format: int64
        startDate:
          $ref: '#/components/schemas/TradeDate'
        expirationDate:
          $ref: '#/components/schemas/TradeDate'
        paidAmount:
          type: number
          format: double
        cancelledRenewal:
          type: boolean
        cancelReason:
          type: string
      required:
        - userId
        - timestamp
        - planPrice
        - tradovateSubscriptionPlanId
        - startDate
        - expirationDate
        - paidAmount
      title: TradovateSubscription
    PlanUpgradeResponse:
      type: object
      properties:
        errorText:
          type: string
          description: Non-empty if the request failed
        errorCode:
          $ref: '#/components/schemas/PlanUpgradeResponseErrorCode'
          description: >-
            ConflictWithExisting, DowngradeNotAllowed,
            IncompatibleCMEMarketDataSubscriptionPlans, IncorrectPaymentMethod,
            InsufficientFunds, PaymentProviderError, PlanDiscontinued,
            SingleTrialOnly, Success, UnknownError
        startDate:
          $ref: '#/components/schemas/TradeDate'
        expirationDate:
          $ref: '#/components/schemas/TradeDate'
        estimatedAmount:
          type: number
          format: double
        current:
          $ref: '#/components/schemas/TradovateSubscription'
        refund:
          type: number
          format: double
      required:
        - startDate
        - expirationDate
      title: PlanUpgradeResponse
  securitySchemes:
    bearer_access_token:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{
  "tradovateSubscriptionPlanId": 3
}
```

**Response**

```json
{
  "startDate": {
    "year": 2024,
    "month": 6,
    "day": 1
  },
  "expirationDate": {
    "year": 2024,
    "month": 6,
    "day": 30
  },
  "errorText": "Switch to the same plan is not allowed. Your membership will be renewed at the end period",
  "errorCode": "ConflictWithExisting",
  "estimatedAmount": 49.99,
  "current": {
    "userId": 56789,
    "timestamp": "2024-05-15T09:30:00Z",
    "planPrice": 49.99,
    "tradovateSubscriptionPlanId": 3,
    "startDate": {
      "year": 2024,
      "month": 5,
      "day": 1
    },
    "expirationDate": {
      "year": 2024,
      "month": 5,
      "day": 31
    },
    "paidAmount": 49.99,
    "id": 1024,
    "cashBalanceLogId": 2048,
    "accountId": 78901,
    "cancelledRenewal": false,
    "cancelReason": ""
  },
  "refund": 0
}
```

**SDK Code**

```python
import requests

url = "https://live.tradovateapi.com/v1/user/calculateplanupgrade"

payload = { "tradovateSubscriptionPlanId": 3 }
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/user/calculateplanupgrade';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"tradovateSubscriptionPlanId":3}'
};

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/user/calculateplanupgrade"

	payload := strings.NewReader("{\n  \"tradovateSubscriptionPlanId\": 3\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/user/calculateplanupgrade")

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  \"tradovateSubscriptionPlanId\": 3\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/user/calculateplanupgrade")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"tradovateSubscriptionPlanId\": 3\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://live.tradovateapi.com/v1/user/calculateplanupgrade', [
  'body' => '{
  "tradovateSubscriptionPlanId": 3
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://live.tradovateapi.com/v1/user/calculateplanupgrade");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"tradovateSubscriptionPlanId\": 3\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["tradovateSubscriptionPlanId": 3] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://live.tradovateapi.com/v1/user/calculateplanupgrade")! 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()
```