> ## Documentation Index
> Fetch the complete documentation index at: https://detrack.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart: Create your first Detrack job in minutes

> Authenticate with your Detrack API key and create your first delivery job with a single POST request in under five minutes.

This quickstart walks you through authenticating with the Detrack API and creating your first delivery job. By the end you'll have a job visible in the Detrack dashboard, ready to dispatch.

## Prerequisites

* A Detrack account with API access enabled.
* Your API key. Find it in the Detrack dashboard under **Integrations > API Key**.
* A terminal with `curl`, or any HTTP client (Postman, Insomnia).

## Step 1: Set your API key

<Steps>
  <Step title="Copy your API key">
    From the Detrack dashboard, go to **Integrations > API Key** and copy the key. Keep it secret; it grants full account access.
  </Step>

  <Step title="Export it as a shell variable">
    ```bash theme={null}
    export DETRACK_API_KEY="<YOUR_API_KEY>"
    ```
  </Step>
</Steps>

## Step 2: Create a delivery job

Send a `POST` request to `/dn/jobs`. Only `do_number` and `date` are always required, but a delivery also needs an `address`. The example below adds a contact and an item.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://app.detrack.com/api/v2/dn/jobs \
    -H "Content-Type: application/json" \
    -H "X-API-KEY: $DETRACK_API_KEY" \
    -d '{
      "data": {
        "type": "Delivery",
        "do_number": "DO-QUICKSTART-1",
        "date": "2026-09-15",
        "address": "1 Marina Bay Sands, Singapore 018956",
        "deliver_to_collect_from": "Jane Smith",
        "phone_number": "6512345678",
        "notify_email": "jane@example.com",
        "items": [
          { "sku": "SKU-001", "description": "Sample package", "quantity": 1 }
        ]
      }
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://app.detrack.com/api/v2/dn/jobs", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-KEY": process.env.DETRACK_API_KEY,
    },
    body: JSON.stringify({
      data: {
        type: "Delivery",
        do_number: "DO-QUICKSTART-1",
        date: "2026-09-15",
        address: "1 Marina Bay Sands, Singapore 018956",
        deliver_to_collect_from: "Jane Smith",
        phone_number: "6512345678",
        notify_email: "jane@example.com",
        items: [{ sku: "SKU-001", description: "Sample package", quantity: 1 }],
      },
    }),
  });

  const job = await response.json();
  console.log(job.data.id);
  ```

  ```python Python theme={null}
  import os
  import requests

  response = requests.post(
      "https://app.detrack.com/api/v2/dn/jobs",
      headers={
          "Content-Type": "application/json",
          "X-API-KEY": os.environ["DETRACK_API_KEY"],
      },
      json={
          "data": {
              "type": "Delivery",
              "do_number": "DO-QUICKSTART-1",
              "date": "2026-09-15",
              "address": "1 Marina Bay Sands, Singapore 018956",
              "deliver_to_collect_from": "Jane Smith",
              "phone_number": "6512345678",
              "notify_email": "jane@example.com",
              "items": [
                  {"sku": "SKU-001", "description": "Sample package", "quantity": 1}
              ],
          }
      },
  )

  print(response.json()["data"]["id"])
  ```
</CodeGroup>

## Step 3: Read the response

A successful create returns `201 Created` with the full job object, including the Detrack-assigned `id` and `detrack_number`:

```json Response theme={null}
{
  "data": {
    "id": "5b22055510c92b1a046ece04",
    "type": "Delivery",
    "do_number": "DO-QUICKSTART-1",
    "date": "2026-09-15",
    "detrack_number": "DET2000001",
    "status": "dispatched",
    "tracking_status": "Info received",
    "address": "1 Marina Bay Sands, Singapore 018956",
    "deliver_to_collect_from": "Jane Smith",
    "items": [
      { "id": "5b22055510c92b1a046ece05", "sku": "SKU-001", "description": "Sample package", "quantity": 1 }
    ]
  }
}
```

For what `status`, `primary_job_status`, and `tracking_status` mean, see [Status fields](/concepts/jobs#status-fields).

The job now appears in the Detrack dashboard for the date you provided.

## Next steps

<CardGroup cols={2}>
  <Card title="Authenticate every request" icon="key" href="/authentication">
    Learn how the `X-API-KEY` header works and how to keep your key safe.
  </Card>

  <Card title="Bulk create jobs" icon="layer-group" href="/api-reference/jobs/bulk-create">
    Push up to 100 jobs in a single request.
  </Card>

  <Card title="Track a job" icon="location-dot" href="/api-reference/jobs/retrieve">
    Retrieve the current status and milestones for any DO number.
  </Card>

  <Card title="Plan a route" icon="route" href="/concepts/routes">
    Build an optimized multi-stop route across drivers.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.