> This page is for Marketplace.

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

# Products & Licenses

Every call on this page needs an access token. To get one, see [Authentication & Access](/marketplace/authentication).

## Products

### Create a Product

Creating a new product (add-on) uses the `POST` method. This call creates a new product entry in the Ecosystem that you can then use for licensing.

```text
POST https://ecosystemapi.ninjatrader.com/v1/products
```

**Authorization:** `Bearer {userID} {username} {currentToken}`

#### Request Body Parameters

| Parameter                         | Type            | Required | Description                                                                                                                                                                                                                                                                        |
| --------------------------------- | --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `product`                         | object          | Yes      | The object that contains the product's fields.                                                                                                                                                                                                                                     |
| `product.name`                    | string          | Yes      | The name of the product. Licenses link to the product by its product ID, not its name, so the name doesn't have to match your add-on's name in NinjaTrader Desktop.                                                                                                                |
| `product.description`             | string          | Yes      | The description of the product.                                                                                                                                                                                                                                                    |
| `product.category`                | string          | Yes      | Set to `"Desktop"` for the NinjaTrader desktop application. Allowed values: `Desktop`.                                                                                                                                                                                             |
| `product.type`                    | string          | Yes      | For NinjaTrader desktop products, `"PrivateInviteOnly"` is recommended. Allowed values: `PublicOpenSource`, `PublicProtected`, `PublicInviteOnly`, `PrivateInviteOnly`.                                                                                                            |
| `product.freeTrialExpirationDays` | integer or null | Yes      | How long a user has immediate, free access. Set to `0` or `null` to disable free trials.                                                                                                                                                                                           |
| `product.isActive`                | boolean         | Yes      | Whether the product appears in the product list for users who don't own it or hold an active license for it (only for products whose `type` isn't `PrivateInviteOnly`). Licenses on the product stay active either way. In most cases, set to `true` when you create your product. |

#### Example Request Body

```json
{
  "product": {
    "name": "My Indicator Suite",
    "description": "A collection of custom NinjaTrader indicators.",
    "category": "Desktop",
    "type": "PrivateInviteOnly",
    "freeTrialExpirationDays": 14,
    "isActive": true
  }
}
```

#### Responses

**`HTTP 200`: Product created**

```json
{
  "result": 4821,
  "errorText": ""
}
```

**`HTTP 400`: Validation error**

```json
{
  "statusCode": 400,
  "error": "Description of what's wrong with the request",
  "requestId": "ID of this request"
}
```

If your account doesn't have vendor access, the call is denied with `HTTP 403`.

#### Code Samples

**`cURL`**

```bash title="cURL"
curl -X POST "https://ecosystemapi.ninjatrader.com/v1/products" \
  -H "Authorization: Bearer 12345 myUsername eyJhbGci..." \
  -H "Content-Type: application/json" \
  -d '{
    "product": {
      "name": "My Indicator Suite",
      "description": "A collection of custom NinjaTrader indicators.",
      "category": "Desktop",
      "type": "PrivateInviteOnly",
      "freeTrialExpirationDays": 14,
      "isActive": true
    }
  }'
```

**`Python`**

```python title="Python"
import requests

url = "https://ecosystemapi.ninjatrader.com/v1/products"

headers = {
    "Authorization": "Bearer 12345 myUsername eyJhbGci...",
    "Content-Type": "application/json"
}

payload = {
    "product": {
        "name": "My Indicator Suite",
        "description": "A collection of custom NinjaTrader indicators.",
        "category": "Desktop",
        "type": "PrivateInviteOnly",
        "freeTrialExpirationDays": 14,
        "isActive": True
    }
}

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

**`JavaScript`**

```javascript title="JavaScript"
const response = await fetch(
  "https://ecosystemapi.ninjatrader.com/v1/products",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer 12345 myUsername eyJhbGci...",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      product: {
        name: "My Indicator Suite",
        description: "A collection of custom NinjaTrader indicators.",
        category: "Desktop",
        type: "PrivateInviteOnly",
        freeTrialExpirationDays: 14,
        isActive: true
      }
    })
  }
);

console.log("Product ID:", (await response.json()).result);
```

**`C#`**

```csharp title="C#"
using var client = new HttpClient();

client.DefaultRequestHeaders.Add(
    "Authorization",
    "Bearer 12345 myUsername eyJhbGci...");

var payload = new {
    product = new {
        name = "My Indicator Suite",
        description = "A collection of custom NinjaTrader indicators.",
        category = "Desktop",
        type = "PrivateInviteOnly",
        freeTrialExpirationDays = 14,
        isActive = true
    }
};

var json = JsonSerializer.Serialize(payload);
var content = new StringContent(
    json, Encoding.UTF8, "application/json");

var res = await client.PostAsync(
    "https://ecosystemapi.ninjatrader.com/v1/products",
    content);

Console.WriteLine(await res.Content.ReadAsStringAsync());
```

### List Your Products

Getting the list of products (add-ons) you've created uses the `GET` method. This call returns the product ID of each product associated with your vendor account.

```text
GET https://ecosystemapi.ninjatrader.com/v1/products/me
```

**Authorization:** `Bearer {userID} {username} {currentToken}`

#### Responses

**`HTTP 200`: List of products**

```json
{
  "result": [
    { "productId": 4821 },
    { "productId": 4790 }
  ],
  "errorText": ""
}
```

**`HTTP 401`: Unauthorized**

```json
{
  "statusCode": 401,
  "error": "Description of the authorization problem",
  "requestId": "ID of this request"
}
```

#### Code Samples

**`cURL`**

```bash title="cURL"
curl -X GET "https://ecosystemapi.ninjatrader.com/v1/products/me" \
  -H "Authorization: Bearer 12345 myUsername eyJhbGci..." \
  -H "Accept: application/json"
```

**`Python`**

```python title="Python"
import requests

url = "https://ecosystemapi.ninjatrader.com/v1/products/me"

headers = {
    "Authorization": "Bearer 12345 myUsername eyJhbGci...",
    "Accept": "application/json"
}

response = requests.get(url, headers=headers)

for product in response.json()["result"]:
    print(product["productId"])
```

**`JavaScript`**

```javascript title="JavaScript"
const response = await fetch(
  "https://ecosystemapi.ninjatrader.com/v1/products/me",
  {
    headers: {
      "Authorization": "Bearer 12345 myUsername eyJhbGci...",
      "Accept": "application/json"
    }
  }
);

const products = (await response.json()).result;
products.forEach(p => console.log(p.productId));
```

**`C#`**

```csharp title="C#"
using var client = new HttpClient();

client.DefaultRequestHeaders.Add(
    "Authorization",
    "Bearer 12345 myUsername eyJhbGci...");

var res = await client.GetAsync(
    "https://ecosystemapi.ninjatrader.com/v1/products/me");

Console.WriteLine(await res.Content.ReadAsStringAsync());
```

## Licenses

### Create a License

Adding a new license for a user uses the `POST` method. This call licenses a specific user (by email) to access one or more of your products.

```text
POST https://ecosystemapi.ninjatrader.com/v1/licenses/vendor
```

**Authorization:** `Bearer {userID} {username} {currentToken}`

#### Request Body Parameters

| Parameter                   | Type              | Required | Description                                                                                                                                                                             |
| --------------------------- | ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `license`                   | object            | Yes      | The object that contains the license's `email` and `expirationDateUTC`.                                                                                                                 |
| `license.email`             | string            | Yes      | The email address of the user's `account.ninjatrader.com` account. Must be 64 characters or fewer.                                                                                      |
| `license.expirationDateUTC` | string or null    | Yes      | The date and time the license expires. Set it to `null` for a lifetime license.                                                                                                         |
| `license.name`              | string            | No       | A label for this license. Must be 100 characters or fewer.                                                                                                                              |
| `productIds`                | array of integers | Yes      | The IDs of the products to license the user for. To license one product, send one ID. List each ID once (a repeated ID returns `HTTP 409`), and you must own every product in the list. |

#### Example Request Body

```json
{
  "license": {
    "email": "user@example.com",
    "expirationDateUTC": "2027-05-11T00:00:00Z"
  },
  "productIds": [4821]
}
```

#### Responses

**`HTTP 200`: License created** (one license ID for each product)

```json
{
  "result": [99201],
  "errorText": ""
}
```

**`HTTP 409`: Duplicate license**

```json
{
  "statusCode": 409,
  "error": "An active license already exists for this email and product",
  "requestId": "ID of this request"
}
```

If you don't own every product in `productIds`, the call is denied with `HTTP 403`. If any check fails, no licenses are created.

#### Code Samples

**`cURL`**

```bash title="cURL"
curl -X POST "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor" \
  -H "Authorization: Bearer 12345 myUsername eyJhbGci..." \
  -H "Content-Type: application/json" \
  -d '{
    "license": {
      "email": "user@example.com",
      "expirationDateUTC": "2027-05-11T00:00:00Z"
    },
    "productIds": [4821]
  }'
```

**`Python`**

```python title="Python"
import requests

url = "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor"

headers = {
    "Authorization": "Bearer 12345 myUsername eyJhbGci...",
    "Content-Type": "application/json"
}

payload = {
    "license": {
        "email": "user@example.com",
        "expirationDateUTC": "2027-05-11T00:00:00Z"
    },
    "productIds": [4821]
}

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

**`JavaScript`**

```javascript title="JavaScript"
const response = await fetch(
  "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer 12345 myUsername eyJhbGci...",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      license: {
        email: "user@example.com",
        expirationDateUTC: "2027-05-11T00:00:00Z"
      },
      productIds: [4821]
    })
  }
);

console.log("License IDs:", (await response.json()).result);
```

**`C#`**

```csharp title="C#"
using var client = new HttpClient();

client.DefaultRequestHeaders.Add(
    "Authorization",
    "Bearer 12345 myUsername eyJhbGci...");

var payload = new {
    license = new {
        email = "user@example.com",
        expirationDateUTC = "2027-05-11T00:00:00Z"
    },
    productIds = new[] { 4821 }
};

var json = JsonSerializer.Serialize(payload);
var content = new StringContent(
    json, Encoding.UTF8, "application/json");

var res = await client.PostAsync(
    "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor",
    content);

Console.WriteLine(await res.Content.ReadAsStringAsync());
```

### List Licenses by Product

To get all licenses for a specific product, call [List All Your Licenses](#list-all-your-licenses) and read that product's entry in `result`, which is keyed by product ID. The entry's `licenses` array lists every license for the product, including expired ones, with each license's email and expiration date. A license is active when its `expirationDateUTC` is `null` or in the future. If you don't own the product, it isn't in `result`, and the samples print nothing.

#### Code Samples

**`Python`**

```python title="Python"
import requests
from datetime import datetime, timezone

url = "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor"
headers = {"Authorization": "Bearer 12345 myUsername eyJhbGci..."}
product_id = 4821

products = requests.get(url, headers=headers).json()["result"]
for lic in products.get(str(product_id), {"licenses": []})["licenses"]:
    expires = lic["expirationDateUTC"]
    active = expires is None or datetime.fromisoformat(
        expires.replace("Z", "+00:00")) > datetime.now(timezone.utc)
    print(f"{lic['email']}: {'Active' if active else 'Expired'}")
```

**`JavaScript`**

```javascript title="JavaScript"
const productId = 4821;

const response = await fetch(
  "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor",
  { headers: { "Authorization": "Bearer 12345 myUsername eyJhbGci..." } }
);

const products = (await response.json()).result;
(products[String(productId)]?.licenses ?? []).forEach(lic => {
  const active = lic.expirationDateUTC === null
    || new Date(lic.expirationDateUTC) > new Date();
  console.log(`${lic.email}: ${active ? "Active" : "Expired"}`);
});
```

### List All Your Licenses

Get every license for every product you own, grouped by product.

```text
GET https://ecosystemapi.ninjatrader.com/v1/licenses/vendor
```

**Authorization:** `Bearer {userID} {username} {currentToken}`

The response's `result` object has one entry per product you own, keyed by product ID. Each entry has the `productId`, the `productName`, and a `licenses` array. Each license has an `id` (the `licenseId` used to update it), the `productId`, the `email` it's licensed to, its `expirationDateUTC` (`null` for a lifetime license), and an optional `name` label.

* Expired licenses are included, so check each license's `expirationDateUTC`.
* A product with no licenses has an empty `licenses` array, and if you don't own any products, `result` is empty.
* If your account doesn't have vendor access, the call returns `HTTP 403`.

#### Responses

**`HTTP 200`: Licenses grouped by product**

```json
{
  "result": {
    "4821": {
      "productId": 4821,
      "productName": "My Indicator Suite",
      "licenses": [
        {
          "id": 99201,
          "productId": 4821,
          "email": "user@example.com",
          "expirationDateUTC": "2027-05-11T00:00:00.000Z",
          "name": null
        },
        {
          "id": 99185,
          "productId": 4821,
          "email": "trader@example.com",
          "expirationDateUTC": null,
          "name": null
        }
      ]
    },
    "4790": {
      "productId": 4790,
      "productName": "Auto Strategy Pack",
      "licenses": []
    }
  },
  "errorText": ""
}
```

#### Code Samples

**`cURL`**

```bash title="cURL"
curl -X GET "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor" \
  -H "Authorization: Bearer 12345 myUsername eyJhbGci..." \
  -H "Accept: application/json"
```

**`Python`**

```python title="Python"
import requests

url = "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor"

headers = {
    "Authorization": "Bearer 12345 myUsername eyJhbGci...",
    "Accept": "application/json"
}

response = requests.get(url, headers=headers)
products = response.json()["result"]

for product in products.values():
    for lic in product["licenses"]:
        print(f"{product['productName']}: {lic['email']}")
```

**`JavaScript`**

```javascript title="JavaScript"
const response = await fetch(
  "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor",
  {
    headers: {
      "Authorization": "Bearer 12345 myUsername eyJhbGci...",
      "Accept": "application/json"
    }
  }
);

const products = (await response.json()).result;
Object.values(products).forEach(product => {
  product.licenses.forEach(lic => {
    console.log(`${product.productName}: ${lic.email}`);
  });
});
```

**`C#`**

```csharp title="C#"
using var client = new HttpClient();

client.DefaultRequestHeaders.Add(
    "Authorization",
    "Bearer 12345 myUsername eyJhbGci...");

var res = await client.GetAsync(
    "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor");

Console.WriteLine(await res.Content.ReadAsStringAsync());
```

### List Licenses by User

To get all licenses assigned to a specific user, call [List All Your Licenses](#list-all-your-licenses) and keep the licenses whose `email` matches the user's email address. Emails are saved in lowercase with any spaces at either end removed, so trim and lowercase both addresses before you compare them.

#### Code Samples

**`Python`**

```python title="Python"
import requests

url = "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor"
headers = {"Authorization": "Bearer 12345 myUsername eyJhbGci..."}
email = "user@example.com".strip().lower()

products = requests.get(url, headers=headers).json()["result"]
for product in products.values():
    for lic in product["licenses"]:
        if lic["email"].strip().lower() == email:
            print(f"{product['productName']}: license {lic['id']}")
```

**`JavaScript`**

```javascript title="JavaScript"
const email = "user@example.com".trim().toLowerCase();

const response = await fetch(
  "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor",
  { headers: { "Authorization": "Bearer 12345 myUsername eyJhbGci..." } }
);

const products = (await response.json()).result;
Object.values(products).forEach(product => {
  product.licenses
    .filter(lic => lic.email.trim().toLowerCase() === email)
    .forEach(lic => console.log(`${product.productName}: license ${lic.id}`));
});
```

### Update a License

Update an existing license for a user. Use this call to change the expiration date of a user's license (for example, to extend a subscription, convert a trial to a paid license, or revoke access by setting an expiration in the past). Set `expirationDateUTC` to `null` for a lifetime license.

```text
PATCH https://ecosystemapi.ninjatrader.com/v1/licenses/vendor/{licenseId}
```

**Authorization:** `Bearer {userID} {username} {currentToken}`

> **Warning**
>
> Wrap the Update a License request body in a `product` object, not the `license` object used by Create a License: `{ "product": { ... } }`.

> **Note**
>
> To change an expiration date, set `expirationDateUTC` to a future UTC date string to extend access, to `null` to grant a lifetime license with no expiration, or to the current date to expire the license immediately. For example, if today is May 26, 2026, setting it to `"2026-05-26T00:00:00Z"` expires the license immediately. The user loses access on their next license check.

#### Finding Your License ID

Before you can update a license, you need its `licenseId`. Call [List All Your Licenses](#list-all-your-licenses) and find the license in its product's `licenses` array; the `id` field is the `licenseId` you need. If you know the user's email, match it against each license's `email` (see [List Licenses by User](#list-licenses-by-user)).

```json
{
  "id": 99201,
  "productId": 4821,
  "email": "user@example.com",
  "expirationDateUTC": "2027-05-11T00:00:00.000Z",
  "name": null
}
```

In this example, the `id` value `99201` is your `licenseId`.

#### Path Parameters

| Parameter   | Type   | Required | Description                                     |
| ----------- | ------ | -------- | ----------------------------------------------- |
| `licenseId` | string | Yes      | The unique license ID of the license to update. |

#### Request Body Parameters

| Parameter                   | Type           | Required | Description                                                                                                                                          |
| --------------------------- | -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `product`                   | object         | Yes      | The wrapper object that contains `email` and `expirationDateUTC`.                                                                                    |
| `product.email`             | string         | No       | The email address of the user's `account.ninjatrader.com` account. Must be 64 characters or fewer. Leave it out to keep the license's current email. |
| `product.expirationDateUTC` | string or null | No       | The new expiration date and time in UTC. Set it to a future date to extend, `null` for a lifetime license, or the current date to expire.            |

#### Example Request Bodies

**Expire a license immediately.** Set `expirationDateUTC` to today's date.

```json
{
  "product": {
    "email": "user@example.com",
    "expirationDateUTC": "2026-05-26T00:00:00Z"
  }
}
```

**Extend a license expiration.** Set `expirationDateUTC` to a future date to grant continued access.

```json
{
  "product": {
    "email": "user@example.com",
    "expirationDateUTC": "2028-01-15T00:00:00Z"
  }
}
```

**Grant a lifetime license.** Set `expirationDateUTC` to `null` to remove any expiration.

```json
{
  "product": {
    "email": "user@example.com",
    "expirationDateUTC": null
  }
}
```

#### Responses

**`HTTP 200`: License updated**

```json
{
  "result": 99201,
  "errorText": ""
}
```

**`HTTP 404`: License not found**

```json
{
  "statusCode": 404,
  "error": "License not found",
  "requestId": "ID of this request"
}
```

If the license belongs to a product you don't own, the call is denied with `HTTP 403`.

#### Code Samples

**`cURL`**

```bash title="cURL"
# ── Expire a license immediately ──
# Set expirationDateUTC to the current date to expire the license
curl -X PATCH "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor/99201" \
  -H "Authorization: Bearer 12345 myUsername eyJhbGci..." \
  -H "Content-Type: application/json" \
  -d '{
    "product": {
      "email": "user@example.com",
      "expirationDateUTC": "2026-05-26T00:00:00Z"
    }
  }'

# ── Extend: "expirationDateUTC": "2028-01-15T00:00:00Z"
# ── Lifetime: "expirationDateUTC": null
```

**`Python`**

```python title="Python"
import requests

license_id = 99201
url = f"https://ecosystemapi.ninjatrader.com/v1/licenses/vendor/{license_id}"

headers = {
    "Authorization": "Bearer 12345 myUsername eyJhbGci...",
    "Content-Type": "application/json"
}

# ── Expire a license immediately ──
payload = {
    "product": {
        "email": "user@example.com",
        "expirationDateUTC": "2026-05-26T00:00:00Z"
    }
}

response = requests.patch(url, headers=headers, json=payload)
data = response.json()
print(f"Updated license: {data['result']}")

# ── Extend: "expirationDateUTC": "2028-01-15T00:00:00Z"
# ── Lifetime: "expirationDateUTC": None
```

**`JavaScript`**

```javascript title="JavaScript"
const licenseId = 99201;

// ── Expire a license immediately ──
const response = await fetch(
  `https://ecosystemapi.ninjatrader.com/v1/licenses/vendor/${licenseId}`,
  {
    method: "PATCH",
    headers: {
      "Authorization": "Bearer 12345 myUsername eyJhbGci...",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      product: {
        email: "user@example.com",
        expirationDateUTC: "2026-05-26T00:00:00Z"
      }
    })
  }
);

const data = await response.json();
console.log("Updated license:", data.result);

// ── Extend: "2028-01-15T00:00:00Z"
// ── Lifetime: null
```

**`C#`**

```csharp title="C#"
using var client = new HttpClient();

client.DefaultRequestHeaders.Add(
    "Authorization",
    "Bearer 12345 myUsername eyJhbGci...");

var licenseId = 99201;

// ── Expire a license immediately ──
var payload = new {
    product = new {
        email = "user@example.com",
        expirationDateUTC = "2026-05-26T00:00:00Z"
    }
};

var json = JsonSerializer.Serialize(payload);
var content = new StringContent(
    json, Encoding.UTF8, "application/json");

var res = await client.PatchAsync(
    $"https://ecosystemapi.ninjatrader.com/v1/licenses/vendor/{licenseId}",
    content);

Console.WriteLine(await res.Content.ReadAsStringAsync());

// ── Extend: "2028-01-15T00:00:00Z"
// ── Lifetime: null
```