# Tracking Object

Source: https://env.7xmtools.com/api-docs/tracking-object.html

Represents a price watch. There can only be one tracking object per ASIN, regardless of the locale; a single tracking object can contain desired prices for all locales.

JSON Object · Returned by: Tracking API

A Tracking Object represents a price watch. There can only be one tracking object per ASIN, regardless of the locale. A single tracking object can contain desired prices for all locales. The tracking object has two child objects: [`TrackingThresholdValue`](https://env.7xmtools.com/api-docs/tracking-object.html#trackingthresholdvalue) and [`TrackingNotifyIf`](https://env.7xmtools.com/api-docs/tracking-object.html#trackingnotifyif).

> **Returned by:** the [Tracking API](https://env.7xmtools.com/api-docs/tracking.html) requests. To *create* a tracking, use the [Tracking Creation Object](https://env.7xmtools.com/api-docs/tracking-creation-object.html) instead.

## Format

```json
{
    "asin": String,
    "createDate": Integer,
    "isActive": Boolean,
    "ttl": Integer,
    "expireNotify": Boolean,
    "mainDomainId": Integer,
    "updateInterval": Integer,
    "metaData": String,
    "trackingListName": String,
    "thresholdValues": TrackingThresholdValue[],
    "notifyIf": TrackingNotifyIf[],
    "notificationType": Boolean[],
    "notificationCSV": Integer[],
    "individualNotificationInterval": Integer
}
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `asin` | String | The tracked product ASIN. Example: `"B00M0QVG3W"` |
| `createDate` | Integer | Creation date of the tracking, in [Keepa Time minutes](https://env.7xmtools.com/api-docs/tracking-object.html#keepa-time-minutes). |
| `isActive` | Boolean | Indicates whether the tracking is active. A tracking is automatically deactivated if the corresponding API account is no longer sufficiently funded. |
| `ttl` | Integer | The time-to-live in hours until the tracking expires and is deleted. When retrieving the tracking object, it is relative to the `createDate`. Possible values:<br>• Any positive integer: time-to-live in hours<br>• `0`: never expires |
| `expireNotify` | Boolean | Triggers a notification if the tracking expires or is removed by the system (e.g., product deprecated). |
| `mainDomainId` | Integer | The main Amazon locale of this tracking, determining the currency used for all desired prices. See the [valid domain IDs](https://env.7xmtools.com/api-docs/tracking-object.html#domain-ids) below. |
| `updateInterval` | Integer | The update interval in hours, determining how often the system will trigger a product update. A setting of 1 hour won't trigger an update exactly every 60 minutes but as close to that as efficiently possible. Throughout a day, it will be updated 24 times, but updates are not perfectly distributed. Possible values: any integer **between** 0 and 25. |
| `metaData` | String | The metadata of this tracking (maximum length is 500 characters). Used to assign text to this tracking, like a user reference or memo. |
| `trackingListName` | String | The name of the tracking list to which this tracking object belongs (maximum length is 64 characters). |
| `thresholdValues` | TrackingThresholdValue\[\] | Contains settings for price or value-related tracking criteria for all locales. See [TrackingThresholdValue](https://env.7xmtools.com/api-docs/tracking-object.html#trackingthresholdvalue) below. |
| `notifyIf` | TrackingNotifyIf\[\] | Contains specific meta tracking criteria like out-of-stock status for all locales. See [TrackingNotifyIf](https://env.7xmtools.com/api-docs/tracking-object.html#trackingnotifyif) below. |
| `notificationType` | Boolean\[\] | Determines through which channels notifications will be sent. Uses [NotificationType](https://env.7xmtools.com/api-docs/tracking-object.html#notificationtype) indexing. `true` means the channel will be used.<br>**Important:** the Tracking API only supports notifications through push webhooks or API pull requests. |
| `notificationCSV` | Integer\[\] | A history of past notifications for this tracking. Each past notification consists of 5 entries, in the format:<br>`[AmazonLocale, Product.csvType, NotificationType, TrackingNotificationCause, KeepaTime]` |
| `individualNotificationInterval` | Integer | A tracking-specific rearm timer. Possible values:<br>• `-1`: use the default notification timer of the user account (changeable via website settings)<br>• `0`: never notify a desired price more than once<br>• Any positive integer: rearm the desired price after *x* minutes |

## TrackingThresholdValue

Contains settings for price or value-related tracking criteria.

```json
{
    "thresholdValueCSV": Integer[],
    "domain": Integer,
    "csvType": Integer,
    "isDrop": Boolean
}
```

| Field | Type | Description |
| --- | --- | --- |
| `thresholdValueCSV` | Integer\[\] | The history of threshold values (or desired prices). Format: `[KeepaTime, value]` |
| `domain` | Integer | The Amazon locale to which this threshold value belongs. Regardless of the locale, the threshold value is always in the currency of the `mainDomainId`. See the [valid domain IDs](https://env.7xmtools.com/api-docs/tracking-object.html#domain-ids) below. |
| `csvType` | Integer | The price type for this threshold value (refer to the `csv` field of the [Product Object](https://env.7xmtools.com/api-docs/product-object.html)). |
| `isDrop` | Boolean | Indicates whether this tracking threshold value tracks value drops (`true`) or value increases (`false`). |

## TrackingNotifyIf

Contains specific meta tracking criteria, such as out-of-stock status.

```json
{
    "domain": Integer,
    "csvType": Integer,
    "notifyIfType": Integer
}
```

| Field | Type | Description |
| --- | --- | --- |
| `domain` | Integer | The Amazon locale to which this `notifyIf` belongs. See the [valid domain IDs](https://env.7xmtools.com/api-docs/tracking-object.html#domain-ids) below. |
| `csvType` | Integer | The price type for this `notifyIf` (refer to the `csv` field of the [Product Object](https://env.7xmtools.com/api-docs/product-object.html)). |
| `notifyIfType` | Integer | Available notification meta trigger types. Possible values:<br>• **0**: `OUT_OF_STOCK`<br>• **1**: `BACK_IN_STOCK` |

## NotificationType

The available notification channels.

> **Note:** Only `API` is available as of now for API tracking.

| Value | Type |
| --- | --- |
| **5** | `API` — push to webhook or pull through API request |

### Valid domain IDs

Used by `mainDomainId` and the `domain` fields of the child objects:

| Domain ID | Locale |
| --- | --- |
| **1** | com |
| **2** | co.uk |
| **3** | de |
| **4** | fr |
| **5** | co.jp |
| **6** | ca |
| **8** | it |
| **9** | es |
| **10** | in |
| **11** | com.mx |
| **12** | com.br |

## Keepa Time Minutes

Time format used for all timestamps. To convert to an uncompressed Unix epoch time:

- **For milliseconds:** `(keepaTime + 21564000) * 60000`
- **For seconds:** `(keepaTime + 21564000) * 60`

## Example

A Tracking Object as returned by the [Tracking API](https://env.7xmtools.com/api-docs/tracking.html): watch the Amazon price on amazon.de for a drop to € 49.99, notify via API, and alert when the product goes out of stock:

```json
{
  "asin": "B00M0QVG3W",
  "createDate": 7650000,
  "isActive": true,
  "ttl": 0,
  "expireNotify": false,
  "mainDomainId": 3,
  "updateInterval": 1,
  "metaData": "customer-42",
  "trackingListName": "My price watches",
  "thresholdValues": [
    {
      "thresholdValueCSV": [7650000, 4999],
      "domain": 3,
      "csvType": 0,
      "isDrop": true
    }
  ],
  "notifyIf": [
    { "domain": 3, "csvType": 0, "notifyIfType": 0 }
  ],
  "notificationType": [false, false, false, false, false, true, false],
  "notificationCSV": [3, 0, 5, 1, 7661500],
  "individualNotificationInterval": -1
}
```

*Illustrative values.* The `notificationCSV` entry above reads: locale `3` (de), price type `0` (Amazon), channel `5` (API), cause `1` (desired price met), at Keepa Time `7661500`.
