The Trackstar API enables you to write data into your end users’ connected accounts. We have done the heavy lifting to unify the body of each action across WMS, so you can write data in a consistent way across all of them. See the Create Order Schema as an example.

However, the required and optional fields may vary depending on the WMS you are writing to. Additionally, some WMS may require a field that is unique to them. To solve this, we have created an endpoint that will return the required and optional fields for a given entity in a given WMS.

The /integrations endpoint

The GET integrations endpoint returns information on our supported WMS. The required, optional, and integration-specific fields for each write operation are returned in the response.

{
  "data": [
    {
      "integration_name": "Some WMS",
      "write_operations": [
        {
          "action": "create_order",
          "url": "POST /wms/orders",
          "required_base_schema_fields": [
            "line_items.product_id",
            "line_items.quantity"
          ],
          "optional_base_schema_fields": [
            "order_number",
            "line_items",
            "channel",
            "trading_partner"
          ],
          "integration_specific_fields": {
            "properties": {
              "warehouse_id": {
                "title": "warehouse_id",
                "type": "string",
                "description": "The warehouse this order will shipped from.",
                "example": "",
                "enum": [
                  "warehouse_1",
                  "warehouse_2"
                ]
              }
            },
            "type": "object",
            "required_fields": [
              "warehouse_id"
            ]
          }
        }
      ],
      "available_actions": [
        "get_inventory",
        "get_products",
        "create_order",
      ]
    }
  ]
}

Example Create Order Request

Based on the response from the /integrations endpoint, the required and optional fields to create an order in the Some WMS WMS are as follows:

FieldDescriptionTypeRequired
line_items.product_idThe product ID of the line itemstringYes
line_items.quantityThe quantity of the line itemnumberYes
order_numberThe order numberstringNo
line_itemsThe line itemsarrayNo
channelThe channelstringNo
trading_partnerThe trading partnerstringNo
warehouse_idThe warehouse IDstringYes

Let’s send in all of the fields for this request:

curl -X POST https://production.trackstarhq.com/wms/orders \
  -H "x-trackstar-api-key: <x-trackstar-api-key>" \
  -H "x-trackstar-access-token: <x-trackstar-access-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "line_items": [
      {
        "product_id": "123",
        "quantity": 2
      }
    ],
    "order_number": "1234",
    "channel": "Retail",
    "trading_partner": "Target",
    "warehouse_id": "warehouse_1"
  }'

And that’s it! You have successfully created an order in your end user’s WMS.