Skip to main content

Update Tracking Parcel

Updates an existing tracking parcel with new information or metadata.

Endpoint

PUT /v1/tracking-parcels/{id}

Authentication

API key required. Include it in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Path Parameters

ParameterTypeDescription
idstringThe ID of the tracking parcel to update.

Request Body

ParameterTypeRequiredDescription
recipient_namestringNoName of the recipient
recipient_emailstringNoEmail of the recipient
recipient_phonestringNoPhone number of the recipient
external_dataobjectNoArbitrary external data to associate with the parcel.

Note: You cannot update the tracking_number or shipping_channel_id of an existing tracking parcel. If you need to change these, you should create a new tracking parcel.

Example Request Body

{
"recipient_name": "John Smith",
"recipient_email": "john.smith@example.com",
"recipient_phone": "+1987654321",
"external_data": {
"order_id": "ORD-789",
"customer_id": "CUST-456"
}
}

Response

200 OK

{
"data": {
"id": "tp_123456",
"tracking_number": "1234567890",
"shipping_channel_id": "ch_123456",
"status": "in_transit",
"recipient_name": "John Smith",
"recipient_email": "john.smith@example.com",
"recipient_phone": "+1987654321",
"external_data": {
"order_id": "ORD-789",
"customer_id": "CUST-456"
},
"created_at": "2025-04-06T10:00:00Z",
"updated_at": "2025-04-07T15:30:00Z"
}
}

Error Responses

Status CodeDescription
400Bad Request - Invalid input parameters
401Unauthorized - Invalid or missing API key
403Forbidden - You don't have permission to update this tracking parcel
404Not Found - The specified tracking parcel could not be found
422Unprocessable Entity - Validation errors
429Too Many Requests - Rate limit exceeded
500Server Error - Something went wrong on our end

Validation Errors

If there are validation errors, the response will include details:

{
"error": {
"message": "The given data was invalid.",
"errors": {
"recipient.email": [
"The email must be a valid email address."
]
}
}
}

Example Request

cURL

curl -X PUT \
https://api.shipping-channels.com/v1/tracking-parcels/tp_123456 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recipient_name": "John Smith",
"recipient_email": "john.smith@example.com",
"recipient_phone": "+1987654321",
"external_data": {
"order_id": "ORD-789",
"customer_id": "CUST-456"
}
}'

PHP

<?php
$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.shipping-channels.com/v1/tracking-parcels/tp_123456', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'recipient_name' => 'John Smith',
'recipient_email' => 'john.smith@example.com',
'recipient_phone' => '+1987654321',
'external_data' => [
'order_id' => 'ORD-789',
'customer_id' => 'CUST-456',
],
],
]);

$data = json_decode($response->getBody(), true);

JavaScript

fetch('https://api.shipping-channels.com/v1/tracking-parcels/tp_123456', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
recipient_name: 'John Smith',
recipient_email: 'john.smith@example.com',
recipient_phone: '+1987654321',
external_data: {
order_id: 'ORD-789',
customer_id: 'CUST-456'
}
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Note

You can only update external tracking parcels. Internal tracking parcels cannot be updated via this endpoint.

Updates to tracking parcels only affect the metadata associated with the tracking parcel (recipient information, external data). The tracking process and status updates are handled automatically by the system and cannot be manually modified.