# Metadata

{% hint style="info" %}
**Enabling Metadata Syncing**

The syncing of Product metadata and Sku metadata can be enabled on a per-merchant basis using the [Toggle Global Feature Flag](/api-reference/merchants/configuration/toggle-merchant-configuration-global-feature-flag.md) endpoint in the Merchant Configuration API. Offer metadata and Sku metadata must be enabled separately.
{% endhint %}

Offer and Sku metadata allows for the custom data that merchants have applied to their products to be surfaced with the Violet Offer and Sku objects. It is currently only enabled on a per-merchant basis as most commerce platforms (including Shopify) require additional API calls to be made in order to access metadata. By enabling metadata on a per-merchant basis we can ensure that the sync performance is not degraded for merchants who don’t utilize metadata.

***

## Schema

When present, metadata will be available in the `metadata` property of an `Offer` or `Sku` object.

<details>

<summary>Example Metadata as part of Offer of Sku</summary>

```json
{
  ...
  "metadata": [{
    "version": 1.0,
    "type": "STRING",
    "external_type": "single_line_text_field",
    "key": "region",
    "value": "US",
    "source": "EXTERNAL"
  }]
  ...
}
```

</details>

`version` - the schema version for the metadata (all will be `1.0` at this time)

`type` - `STRING | JSON | INTEGER | LONG | DECIMAL | BOOLEAN`

`external_type` - raw value type from the external commerce platform

`key` - the key or name that represents the data

`value` - the value of the data

`source` - `INTERNAL | EXTERNAL` (all metadata is `EXTERNAL` at this time)

When the `type` property has a value of `JSON` the `value` property will consist of a serialized JSON string.

<details>

<summary>JSON Example</summary>

```json
{
  ...
  "metadata": [{
    "version": 1.0,
    "type": "JSON",
    "external_type": "json",
    "key": "json_example",
    "value": "{\"key\":\"value\"}",
    "source": "EXTERNAL"
  }]
  ...
}
```

</details>

***

## Including Offer Metadata

By default, Offer metadata is not included in the Offer data returned by the Violet API. To include metadata, you must add an `include` query parameter with a value that contains `metadata`.

Example - `?include=metadata`

This feature works with the following endpoints:

* [Get All Merchant Offers](/api-reference/catalog/offers/get-all-merchant-offers.md)
* [Get Offer By Id](/api-reference/catalog/offers/get-offer-by-id.md)

## Including Sku Metadata

By default, Sku metadata is not included in the Sku data returned by the Violet API. To include metadata, you must add an `include` query parameter with a value that contains `sku_metadata`.

Example - `?include=sku_metadata`

This feature works with the following endpoints:

* [Get All Merchant Offers](/api-reference/catalog/offers/get-all-merchant-offers.md)
* [Get Offer By Id](/api-reference/catalog/offers/get-offer-by-id.md)
* [Get Sku By Id](/api-reference/catalog/skus/get-sku-by-id.md)

***

## Supported Platforms

At this time metadata is limited to merchants on the `SHOPIFY` platform. Support for additional platforms is currently in development.

## Metadata Parity

Once a store is connected and metadata sync is enabled, Violet will sync with the Merchant’s metadata regularly.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.violet.io/prism/catalog/metadata-syncing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
