> For the complete documentation index, see [llms.txt](https://docs.terminal.africa/tship/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.terminal.africa/tship/shipment.md).

# Shipments

The Shipments API allows you to create shipment tasks, track status of shipments and retrieve information about shipments.

### The Shipment Object

This section describes the different attributes available for a shipment.

| address\_to        | *string*        | Delivery address for shipment.                                                                                                                                                                                                                                                                                                         |
| ------------------ | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address\_from      | *string*        | Pickup address for shipment.                                                                                                                                                                                                                                                                                                           |
| address\_return    | *string*        | Return address for shipment.                                                                                                                                                                                                                                                                                                           |
| carrier            | *string*        | Unique identifier for carrier executing shipment.                                                                                                                                                                                                                                                                                      |
| delivery\_date     | *string*        | Delivery date for shipment.                                                                                                                                                                                                                                                                                                            |
| delivery\_arranged | *string*        | Date delivery arranged for shipment.                                                                                                                                                                                                                                                                                                   |
| events             | *array*         | Array of [status updates](https://docs.terminal.africa/tship/miscallaneous/shipment-event.md) on shipment provided by carrier.                                                                                                                                                                                                         |
| extras             | *object*        | Contains additional information related to shipment e.g. ***carrier\_tracking\_url***, ***reference***, ***shipping\_label**, **insurance, commercial\_invoice**, **courier\_instructions***, ***tracking\_number***, ***tracking\_url***. See [Shipment Extras](https://docs.terminal.africa/tship/miscallaneous/shipment-extras.md). |
| hub\_issues        | *object / null* | Every issue a drop-off hub raised about the shipment, and what waits for your answer. `null` when no hub raised anything. See [The Hub Issues Object](#the-hub-issues-object).                                                                                                                                                         |
| id                 | *string*        | Unique identifier for shipment.                                                                                                                                                                                                                                                                                                        |
| metadata           | *object*        | Provide additional information for a shipment.                                                                                                                                                                                                                                                                                         |
| parcel             | *string*        | Unique identifier of parcel to be shipped.                                                                                                                                                                                                                                                                                             |
| parcels            | *string*        | List of parcels to be shipped for a multi-parcel shipment.                                                                                                                                                                                                                                                                             |
| pickup\_date       | *date*          | Pickup date for shipment.                                                                                                                                                                                                                                                                                                              |
| shipment\_id       | *string*        | Unique reference for the shipment.                                                                                                                                                                                                                                                                                                     |
| shipment\_purpose  | *string*        | Purpose of shipment. Options are ***commercial***, ***personal***, ***sample***, ***return-after-repair***, ***return-for-repair.***                                                                                                                                                                                                   |
| rate               | *string*        | Unique identifier of rate used in shipment.                                                                                                                                                                                                                                                                                            |
| status             | *enum*          | Status of shipment. Must be one of draft, cancelled, confirmed, pending, delivered or in-transit.                                                                                                                                                                                                                                      |
| created\_at        | *datetime*      | Time shipment created.                                                                                                                                                                                                                                                                                                                 |
| updated\_at        | *datetime*      | Time shipment last updated.                                                                                                                                                                                                                                                                                                            |

### The Hub Issues Object

When a parcel reaches a Terminal drop-off hub, the hub can report a problem with it, correct its booking or repackage it for a fee. `hub_issues` lists every one of them and says what waits for your answer. [Get Shipment](https://docs.terminal.africa/tship/shipment/get-shipment.md) returns it as `data.hub_issues`, and [Get Hub Issues](https://docs.terminal.africa/tship/shipment/get-hub-issues.md) returns it on its own. Follow the [hub issues workflow](https://docs.terminal.africa/tship/guides/hub-issues-workflow.md) to answer them.

| Attribute    | Type            | Description                                                                                                                                                                                                                                                                             |
| ------------ | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| action       | *object / null* | What waits for your answer: `type` (`approve_or_decline`), `covers` (the issue IDs one answer covers), `total` (`amount` and `currency`; `null` when the charges are in different currencies), `answer_by` and `if_no_answer` (`cancelled_and_kept_at_hub`). `null` when nothing waits. |
| as\_of       | *datetime*      | When the object was read. Keep the latest copy.                                                                                                                                                                                                                                         |
| collection   | *object / null* | Where to collect the parcel when it stays at the hub after a decline or no answer: `reason`, `hub_name`, `address`, `phone`, `ready_at`, `collected_at`, `refunded` and `refund_pending`.                                                                                               |
| hub\_name    | *string / null* | The drop-off hub.                                                                                                                                                                                                                                                                       |
| issues       | *array*         | Every issue, oldest first. See [The Hub Issue Object](#the-hub-issue-object).                                                                                                                                                                                                           |
| shipment\_id | *string*        | Unique reference for the shipment.                                                                                                                                                                                                                                                      |
| status       | *enum*          | The most pressing issue's status: `awaiting_answer`, then `processing`, then `open`; `resolved` when none is.                                                                                                                                                                           |

### The Hub Issue Object

| Attribute     | Type              | Description                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| amount        | *number / null*   | What the issue costs. `null` for a `hub_report`.                                                                                                                                                                                                                                                                                                                                                 |
| answer\_by    | *datetime / null* | The deadline, for an issue that is asked about.                                                                                                                                                                                                                                                                                                                                                  |
| currency      | *string / null*   | Currency of `amount`.                                                                                                                                                                                                                                                                                                                                                                            |
| details       | *object / null*   | For a `booking_correction`: `booked` and `measured` (weight, chargeable weight, parcels), `price`, `contents`, `scale_photos` and `answered_with` (the repackaging fee answered with it). For `repackaging`: `materials`.                                                                                                                                                                        |
| id            | *string*          | Unique identifier for the issue. A hub report with two problems gives two issues, `{report_id}:{type}`.                                                                                                                                                                                                                                                                                          |
| message       | *string*          | Plain text: the words Terminal sends your customer. Show it as it is.                                                                                                                                                                                                                                                                                                                            |
| needs\_answer | *boolean*         | Whether the issue is in `action.covers`.                                                                                                                                                                                                                                                                                                                                                         |
| raised\_at    | *datetime*        | Time the hub raised the issue.                                                                                                                                                                                                                                                                                                                                                                   |
| report\_id    | *string / null*   | The hub's report, for a `hub_report`.                                                                                                                                                                                                                                                                                                                                                            |
| resolved\_at  | *datetime / null* | Time the issue was settled; `null` while it is open.                                                                                                                                                                                                                                                                                                                                             |
| source        | *enum*            | `hub_report` (information only), `booking_correction` or `repackaging`.                                                                                                                                                                                                                                                                                                                          |
| status        | *enum*            | `open`, `awaiting_answer`, `processing`, `approved`, `applied`, `declined`, `expired`, `withdrawn` or `resolved`. See [after the answer](https://docs.terminal.africa/tship/guides/hub-issues-workflow.md#5-after-the-answer).                                                                                                                                                                   |
| title         | *string / null*   | Heading in the customer's words. `null` for a `hub_report`.                                                                                                                                                                                                                                                                                                                                      |
| type          | *enum*            | For a `hub_report`: `weight_discrepancy`, `piece_count_mismatch`, `damaged_package`, `missing_items`, `undeclared_items`, `wrong_description`, `incorrect_address`, `packaging_issue`, `undervaluation`, `restricted_item` or `documentation`. For a `booking_correction`: `heavier`, `bigger`, `parcel_count`, `contents`, `several` or `booking_correction`. For `repackaging`: `repackaging`. |

{% hint style="warning" %}
An approval that gets no answer by `answer_by` lapses: the shipment is cancelled, any refund due is arranged and the parcel is kept at the hub for collection.
{% endhint %}

### Hub Issue Requests

* [Get Hub Issues](https://docs.terminal.africa/tship/shipment/get-hub-issues.md)
* [Quote Hub Issues](https://docs.terminal.africa/tship/shipment/quote-hub-issues.md)
* [Approve Hub Issues](https://docs.terminal.africa/tship/shipment/approve-hub-issues.md)
* [Decline Hub Issues](https://docs.terminal.africa/tship/shipment/decline-hub-issues.md)

### Hub Issue Webhooks

Subscribe to `hub_issue.reported`, `hub_issue.updated` and `hub_issue.reminder`. Each event carries the shipment's whole `hub_issues` object. Follow [Hub Issues Workflow](https://docs.terminal.africa/tship/guides/hub-issues-workflow.md#6-handle-hub-issue-webhooks-safely) to process them safely, and see [Hub Issue Events](https://docs.terminal.africa/tship/miscallaneous/sample-webhook-event-payloads/hub-issue.md) for examples.


---

# 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.terminal.africa/tship/shipment.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.
