---
title: "The fitment object"
slug: "the-fitment-object"
abstract: "Describes the usage and composition of the fitment object."
---
# The fitment object

The fitment object represents the compatibility of an aftermarket product with another product specified by a user when they are interacting with Sitecore Discover services. It is located in the [context object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-context-object.html "The context object").

It is important to send a fitment object only when the product matches the user's chosen fitment in analytic events such as `add to cart`, `order confirm`, `widget click`, and so on.

The use cases are as follows:

- If the search or recommendation API requests were made along with a fitment filter, then corresponding `click` events must include the user's fitment object.
- When a user is on a product details page, the fitment object must be included only when the product matches the user's fitment.
- When a user adds a product to the cart, send the user's fitment that was associated with that product when adding to the cart.
- When a user places an order, send the user's fitment that was associated with that product when it was added to the cart.

> [!important]
> Not ensuring the user's fitment matches the product for which the event is being sent to Discover results in less accurate fitment-based analytics reports.

The following table lists the keys available in the `fitment` object:

| Name | Type | Description |
| --- | --- | --- |
| ids | Array of strings | Array of user fitment IDs. Include this if you have a separate fitment entity with fitment IDs stored in your system. Send a fitment feed to Discover so we can identify your fitment IDs.Example:"fitment": { "ids": ["fitid1", "fitid2"] } |
| items | Array of objects | Array of fitment objects. Include this if you do not have a separate fitment entity.NoteFitment object keys differ by industry and can be customized. Speak to your Sitecore representative about your specific needs.Example:"fitment": { "items": [ { "year": "1990", "make": "Honda", "model": "H1" }, { "year": "2015", "make": "Ford", "model": "F100" } ] } |

Fitments might be specified in one or two different scopes. They might be specified as part of the [context object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-context-object.html "The context object"), as part of the [product object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-product-object.html "The product object"), or both. If they are included as part of the `product` object, different fitments might be associated with each product. Examples of these events are `product viewed`, `product added to cart`, `order confirm`, and `widget click`.

For example, say a user buys a tire that fits a 1980 Toyota Camry (fitment ID: 1111). At the same time, they buy another tire that fits a 2010 Lexus ES300 (fitment ID 2222). In this example, you can specify the fitment for each product in the `add to cart` and `order confirm` events with individual fitments.

> [!note]
> If fitment information is sent at both [context](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-context-object.html "The context object") and [product](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-product-object.html "The product object") level, the product level is honored, and the context level is ignored.

The following code block represents a `fitment` object at the context level. There are two SKUs, but `context` has only one fitment, which is the user's current fitment.

```JSON
{ 
  "type": "order", 
  "name": "confirm", 
  "value": {  
    "context": {     
      "fitment": {     
        "ids": [         
          "1111"       
        ]    
      }   
    },   
    "products": [     
      {
        "sku": "XYZ-111"     
      },     
      {       
        "sku": "XYZ-222"     
      }   
    ] 
  }
}
```

The following code block represents a `fitment` object at the `product` level. Using this method is more accurate as each product clearly specifies its associated fitment.

```JSON
{ 
  "type": "order", 
  "name": "confirm", 
  "value": {   
    "context": {   
    },   
    "products": [    
      {       
        "sku": "XYZ-111",
        "price": 514.99,
        "quantity": 1,  
        "fitment" : {     
          "ids": ["1111"]
        }     
      },     
      {       
        "sku": "XYZ-222",
        "price": 549.99,
        "quantity": 1,  
        "fitment" : {     
          "ids": ["2222"]
        }     
      }   
    ] 
  }
}
```