Advance Shipping Notices (ASNs) are critical for efficient warehouse operations. This guide shows you how to create inbound shipments and track their progress using the Trackstar API.

Overview

The ASN workflow typically involves:
  1. Creating inbound shipments for incoming goods
  2. Tracking receipt and processing status

Creating Inbound Shipments

Use the Create Inbound Shipment endpoint to create ASNs before goods arrive at the warehouse.
For a full list of fields that need to be passed in, see the Programmatic Writes guide.

Create the Inbound Shipment

curl -X POST https://production.trackstarhq.com/wms/inbound-shipments \
  -H "Content-Type: application/json" \
  -H "x-trackstar-api-key: YOUR_API_KEY" \
  -H "x-trackstar-access-token: YOUR_ACCESS_TOKEN" \
  -d '{
    "supplier_object": {"supplier_id": "ACME001", "supplier_name": "Acme Suppliers Inc"},
    "purchase_order_number": "PO-2024-001",
    "expected_arrival_date": "2024-01-20T09:00:00Z",
    "warehouse_id": "warehouse_main",
    "tracking_number": "1234567890",
    "line_items": [
      {"sku": "WIDGET-001", "expected_quantity": 100},
      {"sku": "GADGET-002", "expected_quantity": 50}
    ]
  }'

Sample Response

{
  "data": {
    "id": "inbound_shipment_abc123",
    "warehouse_customer_id": "customer_12345",
    "created_date": "2024-01-18T10:00:00Z",
    "updated_date": "2024-01-18T10:00:00Z",
    "purchase_order_number": "PO-2024-001",
    "status": "open",
    "raw_status": "awaiting_shipment",
    "supplier": "ACME001",
    "supplier_object": {
      "supplier_id": "ACME001",
      "supplier_name": "Acme Suppliers Inc"
    },
    "expected_arrival_date": "2024-01-20T09:00:00Z",
    "warehouse_id": "warehouse_main",
    "line_items": [
      {
        "inventory_item_id": "inv_widget001_main",
        "sku": "WIDGET-001",
        "expected_quantity": 100,
        "received_quantity": 0,
        "unit_cost": 25.00,
        "external_id": "WIDGET-001-ACME"
      },
      {
        "inventory_item_id": "inv_gadget002_main",
        "sku": "GADGET-002",
        "expected_quantity": 50,
        "received_quantity": 0,
        "unit_cost": 45.00,
        "external_id": "GADGET-002-ACME"
      }
    ],
    "receipts": [],
    "ship_from_address": {
      "address1": "100 Supplier Blvd",
      "address2": null,
      "address3": null,
      "city": "Supplier City",
      "state": "CA",
      "postal_code": "90210",
      "country": "US"
    },
    "tracking_numbers": ["1234567890"],
    "notes": ["Priority shipment - expedite receiving"],
    "external_system_url": "https://wms.example.com/inbound/inbound_shipment_abc123",
    "trackstar_tags": ["priority", {"supplier": "acme"}],
    "additional_fields": {
      "supplier_contact": "jane.doe@acme.com",
      "special_handling": "fragile"
    }
  }
}

Tracking Inbound Shipment Updates

Once inbound shipments are created, you can track their progress using the Get Inbound Shipment endpoint.

Fetch the Inbound Shipment

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

Sample Response

{
  "data": {
    "id": "inbound_shipment_abc123",
    "warehouse_customer_id": "customer_12345",
    "created_date": "2024-01-18T10:00:00Z",
    "updated_date": "2024-01-20T15:30:00Z",
    "purchase_order_number": "PO-2024-001",
    "status": "received",
    "raw_status": "fully_received",
    "supplier": "ACME001",
    "supplier_object": {
      "supplier_id": "ACME001",
      "supplier_name": "Acme Suppliers Inc"
    },
    "expected_arrival_date": "2024-01-20T09:00:00Z",
    "warehouse_id": "warehouse_main",
    "line_items": [
      {
        "inventory_item_id": "inv_widget001_main",
        "sku": "WIDGET-001",
        "expected_quantity": 100,
        "received_quantity": 100,
        "unit_cost": 25.00,
        "external_id": "WIDGET-001-ACME"
      },
      {
        "inventory_item_id": "inv_gadget002_main",
        "sku": "GADGET-002",
        "expected_quantity": 50,
        "received_quantity": 50,
        "unit_cost": 45.00,
        "external_id": "GADGET-002-ACME"
      }
    ],
    "receipts": [
      {
        "id": "receipt_001",
        "arrived_date": "2024-01-20T10:15:00Z",
        "line_items": [
          {
            "inventory_item_id": "inv_widget001_main",
            "sku": "WIDGET-001",
            "quantity": 100
          },
          {
            "inventory_item_id": "inv_gadget002_main",
            "sku": "GADGET-002",
            "quantity": 50
          }
        ]
      }
    ],
    "ship_from_address": {
      "address1": "100 Supplier Blvd",
      "address2": null,
      "address3": null,
      "city": "Supplier City",
      "state": "CA",
      "postal_code": "90210",
      "country": "US"
    },
    "tracking_numbers": ["1234567890"],
    "notes": ["Priority shipment - expedite receiving", "All items received in good condition"],
    "external_system_url": "https://wms.example.com/inbound/inbound_shipment_abc123",
    "trackstar_tags": ["priority", {"supplier": "acme"}],
    "additional_fields": {
      "supplier_contact": "jane.doe@acme.com",
      "special_handling": "fragile"
    }
  }
}

Real-time Updates

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

Fetching ASNs

For detailed information about all available inbound shipment statuses and their meanings, see the Inbound Shipments Info page.