> For the complete documentation index, see [llms.txt](https://docs.commercelayer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.commercelayer.io/rules-engine/core-api-integration/virtual-relationships.md).

# Virtual relationships

How to leverage the JSON Web Token info to create rules

The current Core API integration enables you create rules' conditions based on some information contained in the currently issued JWT token, such as:

<table><thead><tr><th width="274">JWT field</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>jwt_customer</code></strong></td><td>The customer associated to the current JWT.</td></tr><tr><td><strong><code>jwt_user</code></strong></td><td>The user associated to the current JWT.</td></tr><tr><td><strong><code>jwt_markets</code></strong></td><td>The list of markets associated to the current JWT.</td></tr><tr><td><strong><code>jwt_stock_locations</code></strong></td><td>The list of stock locations associated to the current JWT.</td></tr><tr><td><strong><code>jwt_custom_claim</code></strong></td><td>The custom claim attached to the current JWT (if any).</td></tr></tbody></table>

{% hint style="warning" %}
These relationships are **virtual**, meaning that, behind the scenes, the integration calls the related [customer](/core-api-reference/customers/object.md), [user](/provisioning/api-reference/user.md), [custom claim](/core/authentication/jwt-bearer.md#creating-the-jwt-assertion) object or the array of [market](/core-api-reference/markets/object.md) or [stock location](/core-api-reference/stock_locations/object.md) objects to fetch the data keeping the `jwt_*` prefix in the outcome payload and API interaction.
{% endhint %}

{% hint style="info" %}
At the moment this relationships are available for the [price](/core-api-reference/prices/object.md) and [SKU](/core-api-reference/skus/object.md) resources only (more to come, keep and eye on the [Core API reference](https://docs.commercelayer.io/core-api-reference/) for any update).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.commercelayer.io/rules-engine/core-api-integration/virtual-relationships.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
