Skip to main content

Create Shipment

Creates a new shipment with one or more parcels.

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)NoThe date the shipment is expected to be shipped (YYYY-MM-DD). Must be today or in the future.
label_formatstringYesDesired label format: pdf or zpl.
label_commentstringNoComment to be printed on the label (max 1000 chars).
contains_documents_onlybooleanNoSet to true if the shipment contains only documents.
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).
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_namestringConditionalFirst name of the sender. Required if company_name is not provided.
last_namestringConditionalLast name of the sender. Required if company_name is not provided.
email_addressstringYesEmail address of the sender.
phone_numberstringYesPhone number of the sender.

recipient_contact Object (Required)​

ParameterTypeRequiredDescription
company_namestringNoCompany name of the recipient.
first_namestringConditionalFirst name of the recipient. Required if company_name is not provided.
last_namestringConditionalLast name of the recipient. Required if company_name is not provided.
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.
provincestringNoProvince or state 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.
provincestringNoProvince or state 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.
provincestringNoProvince or state of the return address.

parcels Array (Required)​

An array of parcel objects. At least one parcel is required.

ParameterTypeRequiredDescription
parcel_typestringYesType of parcel. E.g., package, document.
reference_numberstringNoYour internal reference number for the parcel (max 100 chars).
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.
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 (max 64 chars).
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​

Single Parcel Shipment​

{
"shipping_channel_id": "ch_123456",
"reference_number": "ORD-2025-001",
"shipping_date": "2025-08-15",
"label_format": "pdf",
"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"
},
"parcels": [
{
"parcel_type": "package",
"length_dimension": 10,
"width_dimension": 10,
"height_dimension": 10,
"dimension_unit": "CM",
"weight_amount": 1.5,
"weight_unit": "KG"
}
]
}

Multi-Parcel Shipment​

{
"shipping_channel_id": "ch_123456",
"reference_number": "ORD-2025-002",
"shipping_date": "2025-08-15",
"label_format": "pdf",
"cash_on_delivery_amount": 150.00,
"cash_on_delivery_currency": "CZK",
"sender_contact": {
"company_name": "Sender Co.",
"email_address": "sender@example.com",
"phone_number": "+420123456789"
},
"recipient_contact": {
"first_name": "Jan",
"last_name": "Novak",
"email_address": "jan.novak@example.com",
"phone_number": "+420987654321"
},
"origin_address": {
"street_name": "Hlavni",
"house_number": "1",
"city_name": "Praha",
"postal_code": "11000",
"country_code": "CZ"
},
"destination_address": {
"street_name": "Namesti",
"house_number": "5",
"city_name": "Brno",
"postal_code": "60200",
"country_code": "CZ"
},
"parcels": [
{
"parcel_type": "package",
"reference_number": "PARCEL-001",
"length_dimension": 30,
"width_dimension": 20,
"height_dimension": 15,
"dimension_unit": "CM",
"weight_amount": 2.5,
"weight_unit": "KG"
},
{
"parcel_type": "package",
"reference_number": "PARCEL-002",
"length_dimension": 40,
"width_dimension": 30,
"height_dimension": 20,
"dimension_unit": "CM",
"weight_amount": 5.0,
"weight_unit": "KG"
}
]
}

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 shipment ID/tracking number.
statusstringThe current status of the shipment.
is_successfulbooleanWhether the shipment was successfully created with the provider.
has_labelbooleanWhether a label is available for download.
is_internationalbooleanWhether this is an international shipment.
total_parcels_countintegerTotal number of parcels in the shipment.
parcelsarrayArray of parcel objects with tracking information.
labelobjectLabel information (when available).
cash_on_deliveryobjectCOD information (when applicable).
insuranceobjectInsurance information (when applicable).

Response Example​

{
"data": {
"id": "sh_123456",
"reference_number": "ORD-2025-001",
"shipping_channel_id": "ch_123456",
"provider_shipment_id": "20655836776",
"status": "pending",
"is_successful": true,
"has_label": true,
"is_international": false,
"total_parcels_count": 2,
"label": {
"format": "pdf",
"url": "/v1/shipments/sh_123456/label",
"has_label": true
},
"parcels": [
{
"id": "prc_001",
"parcel_number": 1,
"status": "pending",
"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",
"last_status_update": null
}
},
{
"id": "prc_002",
"parcel_number": 2,
"status": "pending",
"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",
"last_status_update": null
}
}
],
"cash_on_delivery": {
"amount": 150.00,
"currency": "CZK"
},
"shipping_channel": {
"id": "ch_123456",
"name": "Express Channel",
"provider": "ppl"
},
"sender_contact": {
"company_name": "Sender Co.",
"first_name": null,
"last_name": null,
"email_address": "sender@example.com",
"phone_number": "+420123456789"
},
"recipient_contact": {
"company_name": null,
"first_name": "Jan",
"last_name": "Novak",
"email_address": "jan.novak@example.com",
"phone_number": "+420987654321"
},
"origin_address": {
"street_name": "Hlavni",
"house_number": "1",
"apartment_number": null,
"city_name": "Praha",
"postal_code": "11000",
"country_code": "CZ"
},
"destination_address": {
"street_name": "Namesti",
"house_number": "5",
"apartment_number": null,
"city_name": "Brno",
"postal_code": "60200",
"country_code": "CZ"
}
}
}

Error Responses​

Status CodeDescription
400Bad Request - Invalid input parameters
401Unauthorized - Invalid or missing API key
422Unprocessable Entity - Validation errors or provider rejected the shipment
429Too Many Requests - Rate limit exceeded
500Server Error - Something went wrong on our end
503Service Unavailable - Unable to communicate with shipping provider

Example Request​

cURL​

curl -X POST \
https://api.uniship.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",
"label_format": "pdf",
"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"
},
"parcels": [
{
"parcel_type": "package",
"length_dimension": 10,
"width_dimension": 10,
"height_dimension": 10,
"dimension_unit": "CM",
"weight_amount": 1.5,
"weight_unit": "KG"
}
]
}'

PHP​

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

$response = $client->request('POST', 'https://api.uniship.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',
'label_format' => 'pdf',
'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'
],
'parcels' => [
[
'parcel_type' => 'package',
'length_dimension' => 10,
'width_dimension' => 10,
'height_dimension' => 10,
'dimension_unit' => 'CM',
'weight_amount' => 1.5,
'weight_unit' => 'KG'
]
]
],
]);

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

JavaScript​

fetch('https://api.uniship.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',
label_format: 'pdf',
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'
},
parcels: [
{
parcel_type: 'package',
length_dimension: 10,
width_dimension: 10,
height_dimension: 10,
dimension_unit: 'CM',
weight_amount: 1.5,
weight_unit: 'KG'
}
]
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));