Skip to main content

Create Shipment

Creates a new shipment.

Endpoint

POST /v1/shipments

Authentication

API key required. Include it in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Request Body

ParameterTypeRequiredDescription
shipping_channel_idstringYesThe ID of the shipping channel to use for this shipment.
reference_numberstringNoYour internal reference number for this shipment.
shipping_datestring (date)YesThe date the shipment is expected to be shipped (YYYY-MM-DD). Must be today or in the future.
origin_pickup_point_idstringNoID of the origin pickup point (if applicable).
destination_pickup_point_idstringNoID of the destination pickup point (if applicable).
additional_servicesarrayNoArray of additional services for the shipment.
metadataobjectNoArbitrary metadata for the shipment.
enable_trackingbooleanNoWhether to enable tracking for the shipment. Defaults to true.

sender_contact Object (Required)

ParameterTypeRequiredDescription
company_namestringNoCompany name of the sender.
first_namestringYesFirst name of the sender.
last_namestringYesLast name of the sender.
email_addressstringYesEmail address of the sender.
phone_numberstringYesPhone number of the sender.

recipient_contact Object (Required)

ParameterTypeRequiredDescription
company_namestringNoCompany name of the recipient.
first_namestringYesFirst name of the recipient.
last_namestringYesLast name of the recipient.
email_addressstringYesEmail address of the recipient.
phone_numberstringYesPhone number of the recipient.

origin_address Object (Required)

ParameterTypeRequiredDescription
street_namestringYesStreet name of the origin address.
house_numberstringYesHouse number of the origin address.
apartment_numberstringNoApartment number of the origin address.
city_namestringYesCity name of the origin address.
postal_codestringYesPostal code of the origin address.
country_codestringYes2-letter ISO country code of the origin address.

destination_address Object (Required)

ParameterTypeRequiredDescription
street_namestringYesStreet name of the destination address.
house_numberstringYesHouse number of the destination address.
apartment_numberstringNoApartment number of the destination address.
city_namestringYesCity name of the destination address.
postal_codestringYesPostal code of the destination address.
country_codestringYes2-letter ISO country code of the destination address.

return_address Object (Optional)

ParameterTypeRequiredDescription
street_namestringYes (if return_address is present)Street name of the return address.
house_numberstringYes (if return_address is present)House number of the return address.
apartment_numberstringNoApartment number of the return address.
city_namestringYes (if return_address is present)City name of the return address.
postal_codestringYes (if return_address is present)Postal code of the return address.
country_codestringYes (if return_address is present)2-letter ISO country code of the return address.

parcel Object (Required)

ParameterTypeRequiredDescription
parcel_typestringYesType of parcel. E.g., package, document.
reference_numberstringNoYour internal reference number for the parcel.
length_dimensionnumberYesLength of the parcel.
width_dimensionnumberYesWidth of the parcel.
height_dimensionnumberYesHeight of the parcel.
dimension_unitstringYesUnit of dimensions. E.g., CM, IN.
weight_amountnumberYesWeight of the parcel.
weight_unitstringYesUnit of weight. E.g., KG, LB.
label_commentstringNoComment to be printed on the label.
label_formatstringNoDesired label format. E.g., PDF, PNG.
cash_on_delivery_amountnumberNoAmount for Cash on Delivery.
cash_on_delivery_currencystringNoCurrency for Cash on Delivery (3-letter ISO code).
insurance_amountnumberNoAmount for insurance.
insurance_currencystringNoCurrency for insurance (3-letter ISO code).
contains_documents_onlybooleanNoSet to true if the parcel contains only documents.
metadataobjectNoArbitrary metadata for the parcel.

customs_declaration Object (Optional, required for international shipments)

ParameterTypeRequiredDescription
export_reasonstringYes (if customs_declaration is present)Reason for export. E.g., sale, gift, sample.
sender_tax_numberstringNoSender's tax identification number.
receiver_tax_numberstringNoReceiver's tax identification number.
shipment_datestring (date)Yes (if customs_declaration is present)Date of shipment for customs purposes (YYYY-MM-DD).
trade_termsstringNoIncoterms. E.g., DDP, DAP.
sender_eori_numberstringNoSender's EORI number.
invoice_referencestringNoInvoice reference number.
ioss_registration_numberstringNoIOSS registration number.

customs_declaration.items Array (Required if customs_declaration is present)

ParameterTypeRequiredDescription
quantityintegerYesQuantity of the item.
unit_valuenumberYesValue per unit of the item.
unit_value_currencystringYesCurrency of the unit value (3-letter ISO code).
item_typestringYesType of item. E.g., product, document.
origin_country_codestringYes2-letter ISO country code of origin.
harmonized_codestringYesHarmonized System (HS) code (8 digits).
descriptionstringYesDescription of the item.
gross_unit_valuenumberNoGross value per unit of the item.
product_reference_urlstringNoURL to product reference.
skustringNoStock Keeping Unit.
measurement_unitstringNoUnit of measurement for the item.
net_weight_gramsintegerNoNet weight of the item in grams.
gross_weight_gramsintegerNoGross weight of the item in grams.

Example Request Body

{
"shipping_channel_id": "ch_123456",
"reference_number": "ORD-2025-001",
"shipping_date": "2025-08-15",
"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",
"city_name": "New York",
"postal_code": "10001",
"country_code": "US"
},
"destination_address": {
"street_name": "Oak Ave",
"house_number": "456",
"city_name": "Los Angeles",
"postal_code": "90001",
"country_code": "US"
},
"parcel": {
"parcel_type": "package",
"length_dimension": 10,
"width_dimension": 10,
"height_dimension": 10,
"dimension_unit": "CM",
"weight_amount": 1.5,
"weight_unit": "KG",
"label_format": "PDF"
}
}

Response

201 Created

ParameterTypeDescription
idstringThe ID of the shipment.
reference_numberstringYour internal reference number for this shipment.
shipping_channel_idstringThe ID of the shipping channel used for this shipment.
provider_shipment_idstringThe remote provider's tracking number.
statusstringThe current status of the shipment.
total_pricenumberThe total price of the shipment.
currencystringThe currency of the total price.
created_atstringThe timestamp when the shipment was created.
updated_atstringThe timestamp when the shipment was last updated.
{
"data": {
"id": "sh_123456",
"reference_number": "ORD-2025-001",
"shipping_channel_id": "ch_123456",
"provider_shipment_id": "DHL-ABC-123",
"status": "pending",
"total_price": 15.50,
"currency": "USD",
"created_at": "2025-08-10T10:00:00Z",
"updated_at": "2025-08-10T10:05:00Z"
}
}

Error Responses

Status CodeDescription
400Bad Request - Invalid input parameters
401Unauthorized - Invalid or missing API key
422Unprocessable Entity - Validation errors
429Too Many Requests - Rate limit exceeded
500Server Error - Something went wrong on our end

Example Request

cURL

curl -X POST \
https://api.shipping-channels.com/v1/shipments \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"shipping_channel_id": "ch_123456",
"reference_number": "ORD-2025-001",
"shipping_date": "2025-08-15",
"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",
"city_name": "New York",
"postal_code": "10001",
"country_code": "US"
},
"destination_address": {
"street_name": "Oak Ave",
"house_number": "456",
"city_name": "Los Angeles",
"postal_code": "90001",
"country_code": "US"
},
"parcel": {
"parcel_type": "package",
"length_dimension": 10,
"width_dimension": 10,
"height_dimension": 10,
"dimension_unit": "CM",
"weight_amount": 1.5,
"weight_unit": "KG",
"label_format": "PDF"
}
}'

PHP

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

$response = $client->request('POST', 'https://api.shipping-channels.com/v1/shipments', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
"shipping_channel_id" => "ch_123456",
"reference_number" => "ORD-2025-001",
"shipping_date" => "2025-08-15",
"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",
"city_name": "New York",
"postal_code": "10001",
"country_code": "US"
],
"destination_address" => [
"street_name": "Oak Ave",
"house_number": "456",
"city_name": "Los Angeles",
"postal_code": "90001",
"country_code": "US"
],
"parcel" => [
"parcel_type": "package",
"length_dimension": 10,
"width_dimension": 10,
"height_dimension": 10,
"dimension_unit": "CM",
"weight_amount": 1.5,
"weight_unit": "KG",
"label_format": "PDF"
]
],
]);

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

JavaScript

fetch('https://api.shipping-channels.com/v1/shipments', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
shipping_channel_id: "ch_123456",
reference_number: "ORD-2025-001",
shipping_date: "2025-08-15",
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",
city_name: "New York",
postal_code: "10001",
country_code: "US"
},
destination_address: {
street_name: "Oak Ave",
house_number: "456",
city_name: "Los Angeles",
postal_code: "90001",
country_code: "US"
},
parcel: {
parcel_type: "package",
length_dimension: 10,
width_dimension: 10,
height_dimension: 10,
dimension_unit: "CM",
weight_amount: 1.5,
weight_unit: "KG",
label_format: "PDF"
}
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));