> 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

POST https://ecosystemapi.ninjatrader.com/v1/products
Content-Type: application/json

Insert products.

Reference: https://docs.ninjatrader.com/marketplace/rest-api-endpoints/products

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: ecosystem
  version: 1.0.0
paths:
  /products:
    post:
      operationId: Products
      summary: products
      description: Insert products.
      tags:
        - ''
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdResponse'
        '400':
          description: Bad Request - The request was invalid or cannot be served
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Authentication is required or failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - The request was understood but refused
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found - The requested resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An unexpected error occurred
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProductRequest'
servers:
  - url: https://ecosystemapi.ninjatrader.com/v1
    description: production
  - url: https://ecosystemapi-d.ninjatrader.com/v1
    description: development
components:
  schemas:
    CreateProductRequestProductCategory:
      type: string
      enum:
        - Desktop
      title: CreateProductRequestProductCategory
    CreateProductRequestProductType:
      type: string
      enum:
        - PublicOpenSource
        - PublicProtected
        - PublicInviteOnly
        - PrivateInviteOnly
      title: CreateProductRequestProductType
    CreateProductRequestProduct:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        category:
          $ref: '#/components/schemas/CreateProductRequestProductCategory'
        type:
          $ref: '#/components/schemas/CreateProductRequestProductType'
        freeTrialExpirationDays:
          type:
            - integer
            - 'null'
        isActive:
          type: boolean
      required:
        - name
        - description
        - category
        - type
        - freeTrialExpirationDays
        - isActive
      title: CreateProductRequestProduct
    CreateProductRequest:
      type: object
      properties:
        product:
          $ref: '#/components/schemas/CreateProductRequestProduct'
      required:
        - product
      description: CreateProductRequest
      title: CreateProductRequest
    ErrorMessage:
      type: string
      description: ErrorMessage
      title: ErrorMessage
    IdResponse:
      type: object
      properties:
        result:
          type:
            - number
            - 'null'
          format: double
        errorText:
          $ref: '#/components/schemas/ErrorMessage'
      required:
        - result
        - errorText
      description: IdResponse
      title: IdResponse
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          format: double
        error:
          type: string
        requestId:
          type: string
      required:
        - statusCode
        - error
        - requestId
      description: ErrorResponse
      title: ErrorResponse
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{
  "product": {
    "name": "Loretta Goldner",
    "description": "Hearty marigold and ostrich stew, slow-cooked with spearmint and dried chinese broccoli for a comforting, flavorful meal.",
    "category": "Desktop",
    "type": "PublicInviteOnly",
    "freeTrialExpirationDays": 2583,
    "isActive": false
  }
}
```

**Response**

```json
{
  "result": 7170529050632360,
  "errorText": "ceno"
}
```

**SDK Code**

```python
import requests

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

payload = { "product": {
        "name": "Loretta Goldner",
        "description": "Hearty marigold and ostrich stew, slow-cooked with spearmint and dried chinese broccoli for a comforting, flavorful meal.",
        "category": "Desktop",
        "type": "PublicInviteOnly",
        "freeTrialExpirationDays": 2583,
        "isActive": False
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://ecosystemapi.ninjatrader.com/v1/products';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"product":{"name":"Loretta Goldner","description":"Hearty marigold and ostrich stew, slow-cooked with spearmint and dried chinese broccoli for a comforting, flavorful meal.","category":"Desktop","type":"PublicInviteOnly","freeTrialExpirationDays":2583,"isActive":false}}'
};

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://ecosystemapi.ninjatrader.com/v1/products"

	payload := strings.NewReader("{\n  \"product\": {\n    \"name\": \"Loretta Goldner\",\n    \"description\": \"Hearty marigold and ostrich stew, slow-cooked with spearmint and dried chinese broccoli for a comforting, flavorful meal.\",\n    \"category\": \"Desktop\",\n    \"type\": \"PublicInviteOnly\",\n    \"freeTrialExpirationDays\": 2583,\n    \"isActive\": false\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://ecosystemapi.ninjatrader.com/v1/products")

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  \"product\": {\n    \"name\": \"Loretta Goldner\",\n    \"description\": \"Hearty marigold and ostrich stew, slow-cooked with spearmint and dried chinese broccoli for a comforting, flavorful meal.\",\n    \"category\": \"Desktop\",\n    \"type\": \"PublicInviteOnly\",\n    \"freeTrialExpirationDays\": 2583,\n    \"isActive\": false\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://ecosystemapi.ninjatrader.com/v1/products")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"product\": {\n    \"name\": \"Loretta Goldner\",\n    \"description\": \"Hearty marigold and ostrich stew, slow-cooked with spearmint and dried chinese broccoli for a comforting, flavorful meal.\",\n    \"category\": \"Desktop\",\n    \"type\": \"PublicInviteOnly\",\n    \"freeTrialExpirationDays\": 2583,\n    \"isActive\": false\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ecosystemapi.ninjatrader.com/v1/products', [
  'body' => '{
  "product": {
    "name": "Loretta Goldner",
    "description": "Hearty marigold and ostrich stew, slow-cooked with spearmint and dried chinese broccoli for a comforting, flavorful meal.",
    "category": "Desktop",
    "type": "PublicInviteOnly",
    "freeTrialExpirationDays": 2583,
    "isActive": false
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://ecosystemapi.ninjatrader.com/v1/products");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"product\": {\n    \"name\": \"Loretta Goldner\",\n    \"description\": \"Hearty marigold and ostrich stew, slow-cooked with spearmint and dried chinese broccoli for a comforting, flavorful meal.\",\n    \"category\": \"Desktop\",\n    \"type\": \"PublicInviteOnly\",\n    \"freeTrialExpirationDays\": 2583,\n    \"isActive\": false\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["product": [
    "name": "Loretta Goldner",
    "description": "Hearty marigold and ostrich stew, slow-cooked with spearmint and dried chinese broccoli for a comforting, flavorful meal.",
    "category": "Desktop",
    "type": "PublicInviteOnly",
    "freeTrialExpirationDays": 2583,
    "isActive": false
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://ecosystemapi.ninjatrader.com/v1/products")! 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()
```