Create Shipping Channel
Creates a new shipping channel for the authenticated user.
Endpoint
POST /v1/shipping-channels
Authentication
API key required. Include it in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the shipping channel. |
provider | string | Yes | Provider code. Possible values: dhl, dhl_pl, dpd, dpd_pl, spx, mrw, poste_italiane. |
description | string | No | A description for the shipping channel. |
Response
201 Created
{
"data": {
"id": "ch_123456",
"name": "DHL Channel",
"provider": "dhl",
"status": "draft",
"settings": {},
"created_at": "2025-04-07T12:00:00Z",
"updated_at": "2025-04-07T12:00:00Z"
}
}
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid input parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 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 POST \
https://api.shipping-channels.com/v1/shipping-channels \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ \
"name": "DHL Channel", \
"provider": "dhl" \
}'
PHP
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.shipping-channels.com/v1/shipping-channels', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'DHL Channel',
'provider' => 'dhl',
],
]);
$data = json_decode($response->getBody(), true);
JavaScript
fetch('https://api.shipping-channels.com/v1/shipping-channels', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
name: 'DHL Channel',
provider: 'dhl'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Validation
After creating a shipping channel, it will be in the pending_validation status. You should validate the shipping channel to ensure the provided credentials are correct. Once validated, the status will change to active.