Order fulfillment is a core workflow in warehouse management systems. This guide shows you how to create orders and track their progress through the fulfillment process.

Overview

The order fulfillment process typically involves:
  1. Creating an order with product details
  2. Tracking order status through the fulfillment pipeline
  3. Syncing updates and managing order data

Creating Orders

To create an order, use the Create Order endpoint with the required order information including products, quantities, and shipping details.
For a full list of fields that need to be passed in, see the Programmatic Writes guide.

Create the Order

curl -X POST https://production.trackstarhq.com/wms/orders \
  -H "Content-Type: application/json" \
  -H "x-trackstar-api-key: YOUR_API_KEY" \
  -H "x-trackstar-access-token: YOUR_ACCESS_TOKEN" \
  -d '{
    "warehouse_customer_id": "customer_12345",
    "reference_id": "order_2024_001",
    "order_number": "ORD-001",
    "channel_object": {
      "channel_id": "Online Store",
      "channel_name": "shopify"
    },
    "trading_partner": "Direct",
    "shipping_method_id": "1234",
    "shipping_method": "fedex_ground",
    "service_level": "Standard",
    "total_price": 79.98,
    "total_tax": 6.40,
    "ship_to_address": {
      "name": "John Doe",
      "company": null,
      "address1": "123 Main St",
      "address2": "Apt 4B",
      "city": "Anytown",
      "state": "NY",
      "zip_code": "12345",
      "country": "US",
      "phone_number": "+1234567890",
      "email": "john@example.com"
    },
    "line_items": [
      {
        "product_id": "prod_widget_001",
        "sku": "WIDGET-001",
        "quantity": 2,
        "unit_price": 29.99,
        "discount_amount": 1.5
      },
      {
        "product_id": "prod_gadget_002",
        "sku": "GADGET-002",
        "quantity": 1,
        "unit_price": 19.99,
        "discount_amount": 1.5
      }
    ]
  }'

Response

The API will return the created order with a unique Trackstar order ID:
{
  "data": {
    "id": "order_abc123",
    "warehouse_customer_id": "customer_12345",
    "warehouse_id": "warehouse_main",
    "created_date": "2024-01-15T10:00:00Z",
    "updated_date": "2024-01-15T10:00:00Z",
    "reference_id": "order_2024_001",
    "order_number": "ORD-001",
    "status": "open",
    "raw_status": "new_order",
    "channel": "shopify",
    "channel_object": {
      "channel_id": "Online Store",
      "channel_name": "shopify"
    },
    "type": "d2c",
    "trading_partner": "Direct",
    "shipping_method": "fedex_ground",
    "is_third_party_freight": false,
    "third_party_freight_account_number": null,
    "first_party_freight_account_number": null,
    "invoice_currency_code": "USD",
    "total_price": 79.98,
    "total_tax": 6.40,
    "total_discount": 3.00,
    "total_shipping": 5.99,
    "ship_to_address": {
      "name": "John Doe",
      "company": null,
      "address1": "123 Main St",
      "address2": "Apt 4B",
      "city": "Anytown",
      "state": "NY",
      "zip_code": "12345",
      "country": "US",
      "phone_number": "+1234567890",
      "email": "john@example.com"
    },
    "line_items": [
      {
        "product_id": "prod_widget_001",
        "sku": "WIDGET-001",
        "quantity": 2,
        "unit_price": 29.99,
        "is_picked": false,
        "discount_amount": 1.5
      },
      {
        "product_id": "prod_gadget_002",
        "sku": "GADGET-002",
        "quantity": 1,
        "unit_price": 19.99,
        "is_picked": false,
        "discount_amount": 1.5
      }
    ],
    "tags": ["rush_order"],
    "required_ship_date": "2024-01-18T00:00:00Z",
    "saturday_delivery": false,
    "signature_required": false,
    "international_duty_paid_by": null,
    "shipments": [],
    "external_system_url": "https://wms.example.com/orders/order_abc123",
    "trackstar_tags": ["high-priority", {"customer_type": "premium"}],
    "additional_fields": {
      "order_notes": "Handle with care",
      "customer_tier": "gold"
    }
  }
}

Tracking Order Status and Fulfillments

Once an order is created, you can track its progress using the Get Order endpoint.

Fetching an Order

curl -X GET https://production.trackstarhq.com/wms/orders/order_abc123 \
  -H "x-trackstar-api-key: YOUR_API_KEY" \
  -H "x-trackstar-access-token: YOUR_ACCESS_TOKEN"

Sample Response

{
  "data": {
    "id": "order_abc123",
    "warehouse_customer_id": "customer_12345",
    "warehouse_id": "warehouse_main",
    "created_date": "2024-01-15T10:00:00Z",
    "updated_date": "2024-01-16T14:30:00Z",
    "reference_id": "order_2024_001",
    "order_number": "ORD-001",
    "status": "fulfilled",
    "raw_status": "shipped",
    "channel": "shopify",
    "channel_object": {
      "channel_id": "Online Store",
      "channel_name": "shopify"
    },
    "type": "d2c",
    "trading_partner": "Direct",
    "shipping_method": "fedex_ground",
    "is_third_party_freight": false,
    "third_party_freight_account_number": null,
    "first_party_freight_account_number": null,
    "invoice_currency_code": "USD",
    "total_price": 79.98,
    "total_tax": 6.40,
    "total_discount": 3.00,
    "total_shipping": 5.99,
    "ship_to_address": {
      "name": "John Doe",
      "company": null,
      "address1": "123 Main St",
      "address2": "Apt 4B",
      "city": "Anytown",
      "state": "NY",
      "zip_code": "12345",
      "country": "US",
      "phone_number": "+1234567890",
      "email": "john@example.com"
    },
    "line_items": [
      {
        "product_id": "prod_widget_001",
        "sku": "WIDGET-001",
        "quantity": 2,
        "unit_price": 29.99,
        "is_picked": true,
        "discount_amount": 1.5
      },
      {
        "product_id": "prod_gadget_002",
        "sku": "GADGET-002",
        "quantity": 1,
        "unit_price": 19.99,
        "is_picked": true,
        "discount_amount": 1.5
      }
    ],
    "tags": ["rush_order"],
    "required_ship_date": "2024-01-18T00:00:00Z",
    "saturday_delivery": false,
    "signature_required": false,
    "international_duty_paid_by": null,
    "shipments": [
      {
        "shipment_id": "shipment_abc123",
        "warehouse_id": "warehouse_main",
        "shipped_date": "2024-01-16T15:45:00Z",
        "raw_status": "shipped",
        "status": "shipped",
        "shipping_method": "fedex_ground",
        "line_items": [
          {
            "inventory_item_id": "inv_widget001_main",
            "sku": "WIDGET-001",
            "quantity": 2,
            "parent_product_id": null
          },
          {
            "inventory_item_id": "inv_gadget002_main",
            "sku": "GADGET-002",
            "quantity": 1,
            "parent_product_id": null
          }
        ],
        "ship_to_address": {
          "full_name": "John Doe",
          "company": null,
          "address1": "123 Main St",
          "address2": "Apt 4B",
          "address3": null,
          "city": "Anytown",
          "state": "NY",
          "postal_code": "12345",
          "country": "US"
        },
        "ship_from_address": {
          "address1": "456 Warehouse Blvd",
          "address2": null,
          "address3": null,
          "city": "Distribution City",
          "state": "NJ",
          "postal_code": "07001",
          "country": "US"
        },
        "packages": [
          {
            "package_id": "pkg_001",
            "package_name": "12x9x4",
            "tracking_number": "1Z999AA1234567890",
            "tracking_url": "https://www.fedex.com/apps/fedextrack/?tracknumbers=1Z999AA1234567890",
            "shipping_method": "fedex_ground",
            "carrier": "FedEx",
            "shipping_method_id": "fedex_ground",
            "shipping_method_name": "FedEx Ground",
            "carrier_id": "fedex",
            "carrier_name": "FedEx",
            "scac": "FEDX",
            "shipping_cost": 8.95,
            "measurements": {
              "length": 12.0,
              "width": 9.0,
              "height": 4.0,
              "unit": "in",
              "weight": 2.5,
              "weight_unit": "lb"
            },
            "line_items": [
              {
                "inventory_item_id": "inv_widget001_main",
                "sku": "WIDGET-001",
                "quantity": 2,
                "lot_id": null,
                "expiration_date": null,
                "parent_product_id": null
              },
              {
                "inventory_item_id": "inv_gadget002_main",
                "sku": "GADGET-002",
                "quantity": 1,
                "lot_id": null,
                "expiration_date": null,
                "parent_product_id": null
              }
            ]
          }
        ]
      }
    ],
    "external_system_url": "https://wms.example.com/orders/order_abc123",
    "trackstar_tags": ["high-priority", {"customer_type": "premium"}],
    "additional_fields": {
      "order_notes": "Handle with care",
      "customer_tier": "gold"
    }
  }
}

Real-time Updates

Utilize webhooks to get notified each time there is an update to an order by subscribing to order.updated and/or order.shipment.created events.

Order Status Workflow

Orders progress through various fulfillment stages as they move through the warehouse system. For detailed information about all available order statuses and their meanings, see the Orders Info page.