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

# Ingrid Tracking

> Let the Dema Agent look up delivery tracking for an order — carrier, current status, progress history, delivery estimates, and tracking page links — from Ingrid when you ask.

## Overview

Once Ingrid Tracking is connected, the Dema Agent can look up where a delivery is directly inside a conversation — the carrier, the current delivery step and its full progress history, the estimated delivery time, any alerts or exceptions Ingrid has raised, and a customer-facing tracking page link.

Ingrid Tracking is read-only: the agent looks data up, it does not change anything in Ingrid.

<Note>
  This is a **separate integration from Ingrid (Returns)**. Ingrid runs Returns and Delivery Tracking as two different APIs with different credentials, so if you use both, connect Ingrid twice — once on the **Ingrid** card with your Returns API key, and once on the **Ingrid Tracking** card with the values below. Your Returns API key does not work for tracking.
</Note>

The agent only acts when you ask it to.

***

## Prerequisites

* **Ingrid's Tracking product enabled on your Ingrid agreement.** If you only use Ingrid Returns, there is no tracking data to read.
* **A production Delivery Tracking API token** for your Ingrid account.
* **Your Ingrid site ID** — the identifier of the site whose deliveries the agent should look up. It is the same `siteId` used when Ingrid's tracking widget is installed on your site.

<Note>
  Ingrid's API tokens are specific to one environment. Dema connects to Ingrid's **production** environment, so a test or stage token will not work. If you cannot find a Delivery Tracking token or your site ID in the Ingrid platform, ask your Ingrid contact or [support@ingrid.com](mailto:support@ingrid.com) — Ingrid may need to issue the tracking token for you.
</Note>

***

## Connect Ingrid Tracking

<Steps>
  <Step title="Collect your site ID and tracking token from Ingrid">
    You need two values from Ingrid:

    | Value                           | What it is                                                         |
    | ------------------------------- | ------------------------------------------------------------------ |
    | **Site ID**                     | Identifies the site (storefront) the agent looks up deliveries for |
    | **Delivery Tracking API token** | The production API token for Ingrid's Delivery Tracking API        |
  </Step>

  <Step title="Connect in Dema">
    In Dema, go to **Agents → Settings → Integrations**, find **Ingrid Tracking**, and click **Connect**. In the **siteId:token** field, paste your site ID and tracking token joined by a colon, with no spaces:

    ```text theme={null}
    siteId:trackingApiToken
    ```

    Click **Add**. Dema marks the integration as Active.

    <Note>
      There is a single field — combine both values into one string separated by a colon.
    </Note>
  </Step>

  <Step title="Check it works">
    Ask the agent about a recent order, for example: *"Where is order 100542, and has it been delivered?"* If it comes back with the carrier and the delivery steps, the connection works.
  </Step>
</Steps>

<Note>
  If you have several Ingrid sites, connect the one you ask about most. You can name another site in a question when you need to, and the agent will look it up there.
</Note>

***

## What you can ask for

<AccordionGroup>
  <Accordion title="Track a specific order or parcel" icon="truck">
    | Ask the agent to                   | For example                                                                                |
    | ---------------------------------- | ------------------------------------------------------------------------------------------ |
    | Find an order's parcels and status | *"Where is order 100542?"*                                                                 |
    | Look up a tracking number          | *"What has happened to tracking number 1Z999AA10123456784?"*                               |
    | Explain a delay                    | *"Order 100542 hasn't arrived — which step is it stuck on and what does the carrier say?"* |
    | Check a customer's deliveries      | *"Show me the deliveries for [customer@example.com](mailto:customer@example.com)."*        |
  </Accordion>

  <Accordion title="Share a tracking page" icon="link">
    | Ask the agent to              | For example                                          |
    | ----------------------------- | ---------------------------------------------------- |
    | Generate a tracking page link | *"Give me the tracking page link for order 100542."* |
    | Localize the page             | *"Send me that tracking link in Swedish."*           |
  </Accordion>

  <Accordion title="Use tracking alongside your Dema data" icon="chart-line">
    | Ask the agent to                   | For example                                                                                    |
    | ---------------------------------- | ---------------------------------------------------------------------------------------------- |
    | Combine an order with its delivery | *"Summarize order 100542 — what was bought, and where is the parcel now?"*                     |
    | Draft a customer reply             | *"Write a reply to this customer explaining where their parcel is and when it should arrive."* |
  </Accordion>
</AccordionGroup>

<Note>
  Ingrid's Delivery Tracking API answers **one order, tracking number, or customer at a time** — it cannot list deliveries for a date range. So the agent can answer *"where is this order and is it late"*, but not *"what share of deliveries missed the promised date last month"*. Delivery statistics over a period need the tracking data loaded into Dema as a data source instead; talk to us if that is what you are after.
</Note>

<Note>
  The estimated delivery time the agent reports is Ingrid's **current** estimate, and it is revised as carriers report progress. It is not the delivery promise the customer saw at checkout.
</Note>

***

## Rotating the token

Get a new Delivery Tracking token from Ingrid, then click **Reconnect** on the Ingrid Tracking integration card in Dema and enter the new `siteId:token` string.

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Dema says the credential format is wrong">
    The **siteId:token** field must contain your site ID and your tracking token joined by a single colon, with no spaces, and both halves present — for example `my-site-id:eyJhbGciOi...`.
  </Accordion>

  <Accordion title="Dema cannot authenticate">
    Check that it is a **Delivery Tracking** token for Ingrid's **production** environment. The Returns API key from the Returns backoffice does not work here, and neither does a stage token.
  </Accordion>

  <Accordion title="The agent finds no parcels for an order that exists">
    Two common causes: the order belongs to a different Ingrid site than the one you connected — name that site in your question — or Ingrid has no tracking data for it, which happens for orders placed before Tracking was enabled.
  </Accordion>

  <Accordion title="I asked for delivery statistics and the agent looked orders up one by one">
    That is the API's limit, not the agent's. Ingrid's tracking API only answers point lookups, so period-level delivery performance is not something the integration can report. Contact us about loading tracking data into Dema instead.
  </Accordion>
</AccordionGroup>

If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see.

***

## Additional resources

* [Ingrid (Returns) integration](/guides/agent/integrations/ingrid)
* [Ingrid Delivery Tracking documentation](https://developer.ingrid.com/delivery_tracking/)
* [Ingrid API tokens and environments](https://developer.ingrid.com/introduction/)
* [Ingrid support](mailto:support@ingrid.com)
