Update Shipping Channel
Updates an existing shipping channel for the authenticated user.
Endpoint
PUT /v1/shipping-channels/{id}
PATCH /v1/shipping-channels/{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 shipping channel to update. |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | New name of the shipping channel. |
description | string | No | New description for the shipping channel. |
Response
200 OK
{
"data": {
"id": "ch_123456",
"name": "DHL Channel Updated",
"provider": "dhl",
"status": "draft",
"settings": {},
"created_at": "2025-03-26T12:00:00Z",
"updated_at": "2025-03-26T12:00:00Z"
}
}
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid input parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - You don't have permission to access this shipping channel |
| 404 | Not Found - The specified shipping channel could not be found |
| 422 | Unprocessable Entity - Validation errors |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Something went wrong on our end |
Example Request
cURL
curl -X PUT \
https://api.shipping-channels.com/v1/shipping-channels/ch_123456 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "DHL Channel Updated",
"description": "Updated description for DHL channel"
}'
PHP
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://api.shipping-channels.com/v1/shipping-channels/ch_123456', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'DHL Channel Updated',
'description' => 'Updated description for DHL channel',
],
]);
$data = json_decode($response->getBody(), true);
JavaScript
fetch('https://api.shipping-channels.com/v1/shipping-channels/ch_123456', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
name: 'DHL Channel Updated',
description: 'Updated description for DHL channel'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));