> 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/provenance.md).

# Provenance

GIS provides a separate endpoint `/v2/diamonds/{diamond_id}` ([reference](/api-reference/grading-integration-service-gis-api/references/api-v2.md#get-v2-diamonds-diamond_id)) which allows the grading lab to retrieve the provenance of a diamond.

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

* Tracr ID
  {% endhint %}

Example request:

```http
GET /v2/diamonds/kzsrfx4dxupa7a8uyn15wund
```

Example response:

```json
{
    "diamond_id": "kzsrfx4dxupa7a8uyn15wund",
    "shape": "Princess",
    "colour": "G",
    "clarity": "VS1",
    "carats": "0.001",
    "fancy_colour": null,
    "provenance": {
        "provenance_name": "Botswana",
        "provenance_type": "Country",
        "country_code": "BW",
        "mine_name": null,
        "is_locked": false
    },
    "rough_check": true
}
```

## HTTP response status codes

{% tabs %}
{% tab title="200" %}

#### 200 : Success

Returned when the request has been successfully processed.

Example response (see main example above).
{% endtab %}

{% tab title="402" %}

#### 402 : Payment Required

Returned when a diamond is locked.

Example:

```json
{
    "detail": "This diamond is locked and needs to be unlocked by the participant."
}
```

{% endtab %}

{% tab title="404" %}

#### 404 : Not Found

Returned when a Diamond is not found in the Tracr network.

Example:

```json
{
    "detail": "Diamond cannot be found in Tracr"
}
```

{% endtab %}

{% tab title="422" %}

#### 422 : Unprocessable Entity

Returned when the request doesn't match the endpoint data requirements.

Example:

```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 %}

{% tab title="500" %}

#### 500 : Internal Server Error

Returned when an internal error occurred within GIS. Please contact Tracr Support if you encounter this issue.
{% 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 dynamically by asking a question.

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

```
GET https://docs.tracr.com/api-reference/grading-integration-service-gis-api/provenance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
