Catalog availability data

This is for:

Developer
In this article

An availability determines whether a given user can purchase a given product or variant. Availability can be a store inventory, a price list, or anything that controls which user has access to certain products or variants.

Availability item example

If you’re trying to sell a Coveo Soccer Shoes - Red that has two size variants: Coveo Soccer Shoes - Red ; Size 8 and Coveo Soccer Shoes - Red ; Size 9, the JSON of the items may look like the following:

Notes

In your catalog, some of the fields discussed here, such as productID, sku, availabilityid and availableskus may have a different keys. The label of these fields depends on your catalog configuration.

{
  "documentId": "product://001-red",
  "ec_name": "Coveo Soccer Shoes - Red",
  "productid": "001-red",
  "objecttype": "Product",
  "ec_images": ["https://myimagegallery?productid"],
}

Similarily, the following JSONs showcase the variant items:

{
  "documentId": "variant://001-red-size-8",
  "ec_name": "Coveo Soccer Shoes - Red ; Size 8",
  "productid": "001-red",
  "objecttype": "Variant",
  "sku": "001-red-size-8",
}
{
  "documentId": "variant://001-red-size-9",
  "ec_name": "Coveo Soccer Shoes - Red ; Size 9",
  "productid": "001-red",
  "objecttype": "Variant",
  "sku": "001-red-size-9",
}

Given the product and it’s variants, you can create an item to represent availability where a local store contains a finite amount of products:

 {
    "documentId": "store://s000002", 1
    "ec_name": "Montreal Store",
    "lat": 45.4975,
    "long": -73.5687,
    "availabilityid": "s000001", 2
    "objecttype": "Availability" 3
    "availableskus": ["001-red-size-8","001-red-size-9"], 4
 }

The preceding JSON has generic information about the store location lat, long, and store name name.

1 The documentId metadata is the unique identifier of your item in the index and will be used to fill the item’s uri field. This value is essential to update the item’s information. It’s the item’s URI and this value is used to update the item’s information.
2 The availabilityid metadata uniquely identifies each availability channel or price list.
3 The objecttype metadata is crucial in identifying the item as an availability channel in the index.
4 The availableskus metadata defines which variants or products are available through a given channel.
Note

Depending on the way you have structured your data, your availability metadata might be contained in another source. Refer to Leverage variants and availabilities for more information.

Important

When your catalog structure contains large amounts of items and requires availability channels, use the same field name (i.e. availableskus) on both the variant objecttype

{
  "documentId": "variant://001-red-8_wide",
  "FileExtension": ".html",
  "ec_name": "Coveo Soccer Shoes - Red / Size 8 - Wide",
  "sku": "001-red-8_wide",
  "availableskus": ["001-red-8_wide"],
  "productsize": "8",
  "width": "wide",
  "productid": "001-red",
  "objecttype": "Variant"
}

and availability channel objecttype written in an array.

{
  "documentId": "store://montreal",
  "FileExtension": ".html",
  "ec_name": "Montreal Store",
  "availableskus": ["001-red-8_wide", "001-red-7-narrow", "..."],
  "objecttype": "Availability"
}

This will improve the performance of your index.

Returning availability information

Similarly to variants, users are presented with various displayable products. However, they select a variant or product from a specific availability channel when purchasing.

Akin to how variant information can be used to refine and filter search results, availability data can be used in a similar manner. For instance, once a product has been identified in search results, a user might want to refine the results based on availability, displaying only those products available in a particular store or within a specific price list. This is where availability data can help guide and enhance the search experience by providing meaningful filtering capabilities.

If you wish to showcase availability information on the product itself, you can store this data as a dictionary on the product item. For example, if you only wish to show products that can be shipped to the postal code the user lives in, your availability information needs to appear on the product.

See Leverage variants and availabilities on how to achieve this.