Get Shipment
Retrieves a specific shipment by ID.
Endpoint
GET /v1/shipments/{id}
Authentication
API key required. Include it in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The ID of the shipment to retrieve. |
Response
200 OK
| Parameter | Type | Description |
|---|---|---|
id | string | The ID of the shipment. |
reference_number | string | Your internal reference number for this shipment. |
shipping_channel_id | string | The ID of the shipping channel used for this shipment. |
provider_shipment_id | string | The remote provider's shipment ID. |
status | string | The current status of the shipment. |
status_color | string | Color code for the status (for UI display). |
is_successful | boolean | Whether the shipment was successfully created with the provider. |
can_generate_label | boolean | Whether a label can be generated for this shipment. |
has_label | boolean | Whether a label is available for download. |
is_international | boolean | Whether this is an international shipment. |
shipping_date | string | The date the shipment is expected to be shipped. |
estimated_delivery_date | string | Estimated delivery date (when available). |
origin_pickup_point_id | string | ID of the origin pickup point. |
destination_pickup_point_id | string | ID of the destination pickup point. |
additional_services | array | Array of additional services for the shipment. |
metadata | object | Arbitrary metadata for the shipment. |
label | object | Label information (when available). |
label_comment | string | Comment printed on the label. |
contains_documents_only | boolean | Whether shipment contains only documents. |
shipping_channel | object | The shipping channel information. |
sender_contact | object | The sender's contact information. |
recipient_contact | object | The recipient's contact information. |
origin_address | object | The origin address of the shipment. |
destination_address | object | The destination address of the shipment. |
return_address | object | The return address of the shipment. |
parcels | array | Array of parcel objects with tracking information. |
total_parcels_count | integer | Total number of parcels in the shipment. |
cash_on_delivery | object | COD information (when applicable). |
insurance | object | Insurance information (when applicable). |
customs_declaration | object | The customs declaration for international shipments. |
Response Example
{
"data": {
"id": "sh_123456",
"reference_number": "ORD-2025-001",
"shipping_channel_id": "ch_123456",
"provider_shipment_id": "20655836776",
"status": "pending",
"status_color": "yellow",
"is_successful": true,
"can_generate_label": false,
"has_label": true,
"is_international": false,
"shipping_date": "2025-08-15",
"estimated_delivery_date": "2025-08-17",
"origin_pickup_point_id": null,
"destination_pickup_point_id": null,
"additional_services": [],
"metadata": {},
"label": {
"format": "pdf",
"url": "/v1/shipments/sh_123456/label",
"has_label": true
},
"label_comment": null,
"contains_documents_only": false,
"shipping_channel": {
"id": "ch_123456",
"name": "PPL CZ",
"provider": "ppl"
},
"sender_contact": {
"company_name": "Sender Co.",
"first_name": "John",
"last_name": "Doe",
"email_address": "john.doe@example.com",
"phone_number": "+1234567890"
},
"recipient_contact": {
"company_name": "Recipient Co.",
"first_name": "Jane",
"last_name": "Smith",
"email_address": "jane.smith@example.com",
"phone_number": "+1987654321"
},
"origin_address": {
"street_name": "Main St",
"house_number": "123",
"apartment_number": null,
"city_name": "New York",
"postal_code": "10001",
"country_code": "US",
"province": null
},
"destination_address": {
"street_name": "Oak Ave",
"house_number": "456",
"apartment_number": null,
"city_name": "Los Angeles",
"postal_code": "90001",
"country_code": "US",
"province": null
},
"return_address": null,
"parcels": [
{
"id": "prc_001",
"parcel_number": 1,
"status": "pending",
"status_color": "yellow",
"provider_parcel_id": "20655836776",
"provider_tracking_number": "20655836776",
"parcel_type": "package",
"reference_number": "PARCEL-001",
"dimensions": {
"length": 30,
"width": 20,
"height": 15,
"unit": "CM",
"formatted": "30x20x15 CM"
},
"weight": {
"amount": 2.5,
"unit": "KG",
"formatted": "2.5 KG"
},
"tracking_parcel": {
"id": "trk_001",
"tracking_number": "20655836776",
"status": "pending",
"status_color": "yellow",
"last_status_update": "2025-08-15T14:30:00Z"
},
"parcel_specific_comment": null,
"metadata": {},
"error_message": null
},
{
"id": "prc_002",
"parcel_number": 2,
"status": "pending",
"status_color": "yellow",
"provider_parcel_id": "20655836777",
"provider_tracking_number": "20655836777",
"parcel_type": "package",
"reference_number": "PARCEL-002",
"dimensions": {
"length": 40,
"width": 30,
"height": 20,
"unit": "CM",
"formatted": "40x30x20 CM"
},
"weight": {
"amount": 5.0,
"unit": "KG",
"formatted": "5.0 KG"
},
"tracking_parcel": {
"id": "trk_002",
"tracking_number": "20655836777",
"status": "pending",
"status_color": "yellow",
"last_status_update": "2025-08-15T14:30:00Z"
},
"parcel_specific_comment": null,
"metadata": {},
"error_message": null
}
],
"total_parcels_count": 2,
"cash_on_delivery": {
"amount": 150.00,
"currency": "CZK"
},
"insurance": null,
"customs_declaration": null
}
}
Parcel Object
Each parcel in the parcels array contains:
| Field | Type | Description |
|---|---|---|
id | string | Unique parcel ID. |
parcel_number | integer | Sequential number within the shipment (1, 2, 3...). |
status | string | Current status of the parcel. |
status_color | string | Color code for UI display. |
provider_parcel_id | string | Provider's unique ID for this parcel. |
provider_tracking_number | string | Tracking number for this parcel. |
parcel_type | string | Type of parcel (package, document, etc.). |
reference_number | string | Your reference number for this parcel. |
dimensions | object | Parcel dimensions with formatted string. |
weight | object | Parcel weight with formatted string. |
tracking_parcel | object | Tracking information for this parcel. |
parcel_specific_comment | string | Comment specific to this parcel. |
metadata | object | Arbitrary metadata for the parcel. |
error_message | string | Error message if parcel creation failed. |
Error Responses
| Status Code | Description |
|---|---|
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - You don't have permission to access this shipment |
| 404 | Not Found - The specified shipment could not be found |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Something went wrong on our end |
Example Request
cURL
curl -X GET \
https://api.shipping-channels.com/v1/shipments/sh_123456 \
-H "Authorization: Bearer YOUR_API_KEY"
PHP
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.shipping-channels.com/v1/shipments/sh_123456', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);
// Access parcels
foreach ($data['data']['parcels'] as $parcel) {
echo "Parcel #{$parcel['parcel_number']}: {$parcel['provider_tracking_number']}\n";
}
JavaScript
fetch('https://api.shipping-channels.com/v1/shipments/sh_123456', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => {
console.log('Shipment:', data.data.id);
console.log('Total parcels:', data.data.total_parcels_count);
// Access each parcel's tracking number
data.data.parcels.forEach(parcel => {
console.log(`Parcel #${parcel.parcel_number}: ${parcel.provider_tracking_number}`);
});
})
.catch(error => console.error('Error:', error));