Skip to navigation

Products & Licenses

Create products and license them to your customers with the Ecosystem API.
View as Markdown

Every call on this page needs an access token. To get one, see Authentication & Access.

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.

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

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

Request Body Parameters

ParameterTypeRequiredDescription
productobjectYesThe object that contains the product’s fields.
product.namestringYesThe 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.descriptionstringYesThe description of the product.
product.categorystringYesSet to "Desktop" for the NinjaTrader desktop application. Allowed values: Desktop.
product.typestringYesFor NinjaTrader desktop products, "PrivateInviteOnly" is recommended. Allowed values: PublicOpenSource, PublicProtected, PublicInviteOnly, PrivateInviteOnly.
product.freeTrialExpirationDaysinteger or nullYesHow long a user has immediate, free access. Set to 0 or null to disable free trials.
product.isActivebooleanYesWhether 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

{
"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

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

HTTP 400: Validation error

{
"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 -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
}
}'

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.

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

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

Responses

HTTP 200: List of products

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

HTTP 401: Unauthorized

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

Code Samples

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

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.

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

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

Request Body Parameters

ParameterTypeRequiredDescription
licenseobjectYesThe object that contains the license’s email and expirationDateUTC.
license.emailstringYesThe email address of the user’s account.ninjatrader.com account. Must be 64 characters or fewer.
license.expirationDateUTCstring or nullYesThe date and time the license expires. Set it to null for a lifetime license.
license.namestringNoA label for this license. Must be 100 characters or fewer.
productIdsarray of integersYesThe 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

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

Responses

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

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

HTTP 409: Duplicate license

{
"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 -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]
}'

List Licenses by Product

To get all licenses for a specific product, call 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

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'}")

List All Your Licenses

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

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

{
"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 -X GET "https://ecosystemapi.ninjatrader.com/v1/licenses/vendor" \
-H "Authorization: Bearer 12345 myUsername eyJhbGci..." \
-H "Accept: application/json"

List Licenses by User

To get all licenses assigned to a specific user, call 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

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']}")

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.

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

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

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

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

{
"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

ParameterTypeRequiredDescription
licenseIdstringYesThe unique license ID of the license to update.

Request Body Parameters

ParameterTypeRequiredDescription
productobjectYesThe wrapper object that contains email and expirationDateUTC.
product.emailstringNoThe 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.expirationDateUTCstring or nullNoThe 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.

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

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

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

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

Responses

HTTP 200: License updated

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

HTTP 404: License not found

{
"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

# ── 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