> For the complete documentation index, see [llms.txt](https://docs.tracr.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tracr.com/api-reference/grading-integration-service-gis-api/qr-code.md).

# QR Code

We have provided a new QR endpoint `/v2/diamonds/{diamond_id}/qr` ([reference](https://docs.tracr.com/api-reference/grading-integration-service-gis-api/references/api-v2.md#get-v2-diamonds-diamond_id-qr)) which allows the grading lab to link the grading report and/or website to [Tracr Diamond Experience](https://search.tracr.com/).

The QR code is unique to each diamond.

{% hint style="info" %}
Please note:

* Diamonds need to be **unlocked** by the participant prior to the grading lab retrieving the QR Code for a Tracr diamond.
  {% endhint %}

{% hint style="info" %}
Required Data:

* Tracr ID
  {% endhint %}

Example request

{% code title="Request" %}

```http
GET /v2/diamonds/ssbjk6aawzje50b3o77r8tx6u/qr
```

{% endcode %}

The endpoint returns the content of the PNG file. The binary stream can be dumped into a file.

<figure><img src="https://3639174932-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFwnFoE2UHxzzy0mGEhPm%2Fuploads%2Fjd7P3MuxH1KgLVPAOm2w%2F52abc006-9a24-4b05-aa37-6ae13c8644f3.png?alt=media&amp;token=ffa5f9f1-30de-49a1-acb1-557e93a0a84b" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="PNG (200)" %}
Returned a QR linking to this diamond in the Diamond Experience. The response body is the binary PNG content; save to a file (e.g., qr.png) and open it.
{% endtab %}

{% tab title="JSON (422)" %}
Returned when the request doesn't match the endpoint data requirements.

```json
{
    "detail": [
        {
            "loc": [
                "path",
                "diamond_id"
            ],
            "msg": "string does not match regex \"^[a-z\\d]{20,98}$\"",
            "type": "value_error.str.regex",
            "ctx": {
                "pattern": "^[a-z\\d]{20,98}$"
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}


---

# 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.tracr.com/api-reference/grading-integration-service-gis-api/qr-code.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.
