> 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/tracr-api/shipments_outbound.md).

# Shipments outbound

Please see the [Shipments Outbound](https://docs.tracr.com/tracr-user-guide/7.-shipments-outbound.md) documentation for help on transferring diamonds to another Tracr instance.

## Transfer rough diamonds

Producers can send a shipment of rough diamonds to a manufacturer using the Tracr API. First, select the Tracr diamond IDs to put in a shipment (using the Tracr API or Portal), then:

Call `POST /v2/transfer/out/start`

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

```json
{
    "diamonds": [
        {
            "diamond_id": "gy9zacqpt64rfm5l9aj8fdgc"
        },
        {
            "diamond_id": "nmg7r5yhut68fz4czxnvanoc"
        }
    ],
    "receiver": "https://api.manufacturer.uat.tracr.com",
    "shipment_name": "Rough Shipment",
    "shipment_type": "rough"
}
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "shipment_id": "rhgy6z6e7j1mwd11nbqc0urg",
    "shipment_name": "Rough Shipment",
    "diamonds": [
        {
            "diamond_id": "gy9zacqpt64rfm5l9aj8fdgc",
            "lifecycle_state": "rough",
            "participant_id": "rough_1",
            "polished": null,
            "rough": {
                "carats": 2.57,
                "colour": null,
                "model": null,
                "quality": null,
                "stress": null,
                "box_id": "demo_rough_box",
                "sight_year": null,
                "sight_number": null
            },
            "status": "success"
        },
        {
            "diamond_id": "nmg7r5yhut68fz4czxnvanoc",
            "lifecycle_state": "rough",
            "participant_id": "rough_2",
            "polished": null,
            "rough": {
                "carats": 0.64,
                "colour": null,
                "model": null,
                "quality": null,
                "stress": null,
                "box_id": "demo_rough_box",
                "sight_year": null,
                "sight_number": null
            },
            "status": "success"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Transfer polished diamonds

Manufacturers can transfer the ownership of polished diamonds to other manufacturers and retailers.

> ### Please note
>
> Polished diamonds may only be transferred provided:
>
> * The diamonds are unlocked (fees apply for unlocking diamonds)
> * The diamonds have inscription numbers

To initiate a transfer of polished diamonds, pass the list of polished diamonds to the endpoint:

Call `POST /v2/transfer/out/start`

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

```json
{
    "diamonds": [
        {
            "diamond_id": "a2uj544df5t5awu5v792wyj6"
        },
        {
            "diamond_id": "jo55p0yxbk7slopptdwv0zol"
        }
    ],
    "receiver": "https://api.manufacturer.tracr.local",
    "shipment_name": "Polished Shipment",
    "shipment_type": "polished"
}
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "shipment_id": "ftduqi7nsiaw4vn0039va92v",
    "shipment_name": "Polished Shipment",
    "diamonds": [
        {
            "diamond_id": "a2uj544df5t5awu5v792wyj6",
            "lifecycle_state": "polished",
            "participant_id": "demo_1_polished_1",
            "polished": {
                "carats": 1.01,
                "clarity": "SI1",
                "colour": "F",
                "cut_grade": "EX",
                "inscription_numbers": [
                    "GIA 2141438167"
                ],
                "shape": "Round"
            },
            "rough": null,
            "status": "success"
        },
        {
            "diamond_id": "jo55p0yxbk7slopptdwv0zol",
            "lifecycle_state": "polished",
            "participant_id": "demo_1_polished_2",
            "polished": {
                "carats": 0.31,
                "clarity": "VVS1",
                "colour": "F",
                "cut_grade": "EX",
                "inscription_numbers": [
                    "GIA 1234567891"
                ],
                "shape": "Pear"
            },
            "rough": null,
            "status": "success"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## View outbound shipments

To list all outbound shipments:

Call `GET /v2/shipment/outbound`

```json
{
    "next": null,
    "page": 1,
    "pages": 1,
    "previous": null,
    "results": [
        {
            "created_at": "2024-05-31T11:31+0000",
            "diamonds": [
                {
                    "created_at": "2024-05-31T11:31+0000",
                    "diamond_id": "gy9zacqpt64rfm5l9aj8fdgc",
                    "lifecycle_state": "rough",
                    "participant_id": "rough_1",
                    "rough": {
                        "carats": "2.57",
                        "colour": null,
                        "model": null,
                        "quality": null,
                        "stress": null,
                        "box_id": null,
                        "sight_year": null,
                        "sight_number": null
                    },
                    "transfer_state": "transferred",
                    "updated_at": "2024-05-31T15:07+0000",
                    "polished": null
                },
                {
                    "created_at": "2024-05-31T11:31+0000",
                    "diamond_id": "nmg7r5yhut68fz4czxnvanoc",
                    "lifecycle_state": "rough",
                    "participant_id": "rough_2",
                    "rough": {
                        "carats": "0.64",
                        "colour": null,
                        "model": null,
                        "quality": null,
                        "stress": null,
                        "box_id": null,
                        "sight_year": null,
                        "sight_number": null
                    },
                    "transfer_state": "transferred",
                    "updated_at": "2024-05-31T15:08+0000",
                    "polished": null
                }
            ],
            "id": "rhgy6z6e7j1mwd11nbqc0urg",
            "name": "Rough Shipment",
            "receiver": "https://api.manufacturer.tracr.local",
            "shipment_type": "rough",
            "status": "complete"
        },
        {
            "created_at": "2024-05-31T14:55+0000",
            "diamonds": [
                {
                    "created_at": "2024-05-31T14:55+0000",
                    "diamond_id": "xyr7pse2lllekbdup54fqsux",
                    "lifecycle_state": "rough",
                    "participant_id": "rough_3",
                    "rough": {
                        "carats": "1.67",
                        "colour": null,
                        "model": null,
                        "quality": null,
                        "stress": null,
                        "box_id": null,
                        "sight_year": null,
                        "sight_number": null
                    },
                    "transfer_state": "transfer_out_confirmed",
                    "updated_at": "2024-05-31T14:55+0000",
                    "polished": null
                },
                {
                    "created_at": "2024-05-31T14:55+0000",
                    "diamond_id": "z3p3egbrrvzd8zsxax2ba5fn",
                    "lifecycle_state": "rough",
                    "participant_id": "rough_4",
                    "rough": {
                        "carats": "0.95",
                        "colour": null,
                        "model": null,
                        "quality": null,
                        "stress": null,
                        "box_id": null,
                        "sight_year": null,
                        "sight_number": null
                    },
                    "transfer_state": "transfer_out_confirmed",
                    "updated_at": "2024-05-31T14:55+0000",
                    "polished": null
                }
            ],
            "id": "gpchul9fhqyo6tf23kzuodjl",
            "name": "Rough Shipment 2",
            "receiver": "https://api.manufacturer.tracr.local",
            "shipment_type": "rough",
            "status": "sent"
        }
    ],
    "total": 2
}
```

This endpoint support various filters. For example, to return only those shipments that have completed processing:

Call `GET /v2/shipment/outbound?status=complete`

```json
{
    "next": null,
    "page": 1,
    "pages": 1,
    "previous": null,
    "results": [
        {
            "created_at": "2024-05-31T11:31+0000",
            "diamonds": [
                {
                    "created_at": "2024-05-31T11:31+0000",
                    "diamond_id": "gy9zacqpt64rfm5l9aj8fdgc",
                    "lifecycle_state": "rough",
                    "participant_id": "rough_1",
                    "rough": {
                        "carats": "2.57",
                        "colour": null,
                        "model": null,
                        "quality": null,
                        "stress": null,
                        "box_id": null,
                        "sight_year": null,
                        "sight_number": null
                    },
                    "transfer_state": "transferred",
                    "updated_at": "2024-05-31T15:07+0000",
                    "polished": null
                },
                {
                    "created_at": "2024-05-31T11:31+0000",
                    "diamond_id": "nmg7r5yhut68fz4czxnvanoc",
                    "lifecycle_state": "rough",
                    "participant_id": "rough_2",
                    "rough": {
                        "carats": "0.64",
                        "colour": null,
                        "model": null,
                        "quality": null,
                        "stress": null,
                        "box_id": null,
                        "sight_year": null,
                        "sight_number": null
                    },
                    "transfer_state": "transferred",
                    "updated_at": "2024-05-31T15:08+0000",
                    "polished": null
                }
            ],
            "id": "rhgy6z6e7j1mwd11nbqc0urg",
            "name": "Rough Shipment",
            "receiver": "https://api.manufacturer.tracr.local",
            "shipment_type": "rough",
            "status": "complete"
        }
    ],
    "total": 1
}
```

To view a specific outbound shipment

Call `GET v2/shipment/outbound/gpchul9fhqyo6tf23kzuodjl`

```json
{
    "created_at": "2024-05-31T14:55+0000",
    "diamonds": [
        {
            "created_at": "2024-05-31T14:55+0000",
            "diamond_id": "xyr7pse2lllekbdup54fqsux",
            "lifecycle_state": "rough",
            "participant_id": "rough_3",
            "rough": {
                "carats": "1.67",
                "colour": null,
                "model": null,
                "quality": null,
                "stress": null,
                "box_id": null,
                "sight_year": null,
                "sight_number": null
            },
            "transfer_state": "transfer_out_confirmed",
            "updated_at": "2024-05-31T14:55+0000",
            "polished": null
        },
        {
            "created_at": "2024-05-31T14:55+0000",
            "diamond_id": "z3p3egbrrvzd8zsxax2ba5fn",
            "lifecycle_state": "rough",
            "participant_id": "rough_4",
            "rough": {
                "carats": "0.95",
                "colour": null,
                "model": null,
                "quality": null,
                "stress": null,
                "box_id": null,
                "sight_year": null,
                "sight_number": null
            },
            "transfer_state": "transfer_out_confirmed",
            "updated_at": "2024-05-31T14:55+0000",
            "polished": null
        }
    ],
    "id": "gpchul9fhqyo6tf23kzuodjl",
    "name": "Rough Shipment 2",
    "receiver": "https://api.manufacturer.tracr.local",
    "shipment_type": "rough",
    "status": "sent"
}
```

## Cancel a shipment

An outbound shipment can be cancelled by the sender.

> **An important note regarding the cancellation of a shipment**
>
> Cancelling a shipment means Tracr will individually cancel the transfer of each diamond in the shipment. If some diamonds have already been accepted by the receiver, the transfer cannot be cancelled and reverted.

Call `POST /transfer/out/gpchul9fhqyo6tf23kzuodjl/cancel`

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

```json
[
    {
        "diamond_id": "xyr7pse2lllekbdup54fqsux"
    },
    {
        "diamond_id": "z3p3egbrrvzd8zsxax2ba5fn"
    }
]
```

{% endtab %}

{% tab title="Response" %}

```json
[
    {
        "diamond_id": "xyr7pse2lllekbdup54fqsux",
        "status": "success"
    },
    {
        "diamond_id": "z3p3egbrrvzd8zsxax2ba5fn",
        "status": "success"
    }
]
```

{% 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/tracr-api/shipments_outbound.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.
