curl --request POST \
--url https://api.ship.uniuni.com/prod/client/shipments/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipient": {
"name": "Jane Doe",
"phone": "+1-604-123-4567",
"email": "jane@example.com",
"signature": false
},
"address": {
"address1": "3460 Cawthra Road",
"city": "Mississauga",
"province": "ON",
"postalCode": "L5A 2Y1",
"country": "CA"
},
"dimensions": {
"length": 1,
"width": 1,
"height": 1,
"dimensionUnit": "INCH"
},
"weight": {
"value": 1,
"weightUnit": "LB"
},
"postageType": "STANDARD",
"note": "Gift Box",
"shipmentLineItems": [
{
"description": "T-shirt",
"quantity": 1,
"unit_value": 10,
"currency": "CAD"
}
]
}
'import requests
url = "https://api.ship.uniuni.com/prod/client/shipments/create"
payload = {
"recipient": {
"name": "Jane Doe",
"phone": "+1-604-123-4567",
"email": "jane@example.com",
"signature": False
},
"address": {
"address1": "3460 Cawthra Road",
"city": "Mississauga",
"province": "ON",
"postalCode": "L5A 2Y1",
"country": "CA"
},
"dimensions": {
"length": 1,
"width": 1,
"height": 1,
"dimensionUnit": "INCH"
},
"weight": {
"value": 1,
"weightUnit": "LB"
},
"postageType": "STANDARD",
"note": "Gift Box",
"shipmentLineItems": [
{
"description": "T-shirt",
"quantity": 1,
"unit_value": 10,
"currency": "CAD"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
recipient: {
name: 'Jane Doe',
phone: '+1-604-123-4567',
email: 'jane@example.com',
signature: false
},
address: {
address1: '3460 Cawthra Road',
city: 'Mississauga',
province: 'ON',
postalCode: 'L5A 2Y1',
country: 'CA'
},
dimensions: {length: 1, width: 1, height: 1, dimensionUnit: 'INCH'},
weight: {value: 1, weightUnit: 'LB'},
postageType: 'STANDARD',
note: 'Gift Box',
shipmentLineItems: [{description: 'T-shirt', quantity: 1, unit_value: 10, currency: 'CAD'}]
})
};
fetch('https://api.ship.uniuni.com/prod/client/shipments/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ship.uniuni.com/prod/client/shipments/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'recipient' => [
'name' => 'Jane Doe',
'phone' => '+1-604-123-4567',
'email' => 'jane@example.com',
'signature' => false
],
'address' => [
'address1' => '3460 Cawthra Road',
'city' => 'Mississauga',
'province' => 'ON',
'postalCode' => 'L5A 2Y1',
'country' => 'CA'
],
'dimensions' => [
'length' => 1,
'width' => 1,
'height' => 1,
'dimensionUnit' => 'INCH'
],
'weight' => [
'value' => 1,
'weightUnit' => 'LB'
],
'postageType' => 'STANDARD',
'note' => 'Gift Box',
'shipmentLineItems' => [
[
'description' => 'T-shirt',
'quantity' => 1,
'unit_value' => 10,
'currency' => 'CAD'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ship.uniuni.com/prod/client/shipments/create"
payload := strings.NewReader("{\n \"recipient\": {\n \"name\": \"Jane Doe\",\n \"phone\": \"+1-604-123-4567\",\n \"email\": \"jane@example.com\",\n \"signature\": false\n },\n \"address\": {\n \"address1\": \"3460 Cawthra Road\",\n \"city\": \"Mississauga\",\n \"province\": \"ON\",\n \"postalCode\": \"L5A 2Y1\",\n \"country\": \"CA\"\n },\n \"dimensions\": {\n \"length\": 1,\n \"width\": 1,\n \"height\": 1,\n \"dimensionUnit\": \"INCH\"\n },\n \"weight\": {\n \"value\": 1,\n \"weightUnit\": \"LB\"\n },\n \"postageType\": \"STANDARD\",\n \"note\": \"Gift Box\",\n \"shipmentLineItems\": [\n {\n \"description\": \"T-shirt\",\n \"quantity\": 1,\n \"unit_value\": 10,\n \"currency\": \"CAD\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ship.uniuni.com/prod/client/shipments/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipient\": {\n \"name\": \"Jane Doe\",\n \"phone\": \"+1-604-123-4567\",\n \"email\": \"jane@example.com\",\n \"signature\": false\n },\n \"address\": {\n \"address1\": \"3460 Cawthra Road\",\n \"city\": \"Mississauga\",\n \"province\": \"ON\",\n \"postalCode\": \"L5A 2Y1\",\n \"country\": \"CA\"\n },\n \"dimensions\": {\n \"length\": 1,\n \"width\": 1,\n \"height\": 1,\n \"dimensionUnit\": \"INCH\"\n },\n \"weight\": {\n \"value\": 1,\n \"weightUnit\": \"LB\"\n },\n \"postageType\": \"STANDARD\",\n \"note\": \"Gift Box\",\n \"shipmentLineItems\": [\n {\n \"description\": \"T-shirt\",\n \"quantity\": 1,\n \"unit_value\": 10,\n \"currency\": \"CAD\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ship.uniuni.com/prod/client/shipments/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"recipient\": {\n \"name\": \"Jane Doe\",\n \"phone\": \"+1-604-123-4567\",\n \"email\": \"jane@example.com\",\n \"signature\": false\n },\n \"address\": {\n \"address1\": \"3460 Cawthra Road\",\n \"city\": \"Mississauga\",\n \"province\": \"ON\",\n \"postalCode\": \"L5A 2Y1\",\n \"country\": \"CA\"\n },\n \"dimensions\": {\n \"length\": 1,\n \"width\": 1,\n \"height\": 1,\n \"dimensionUnit\": \"INCH\"\n },\n \"weight\": {\n \"value\": 1,\n \"weightUnit\": \"LB\"\n },\n \"postageType\": \"STANDARD\",\n \"note\": \"Gift Box\",\n \"shipmentLineItems\": [\n {\n \"description\": \"T-shirt\",\n \"quantity\": 1,\n \"unit_value\": 10,\n \"currency\": \"CAD\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Shipment created successfully",
"code": 0,
"data": {
"orderNumber": "UNI031455E90",
"trackingId": "UR07300000000005351",
"recipient": {
"name": "Jane Doe",
"phone": "+1-604-123-4567",
"email": "jane@example.com"
},
"address": {
"address1": "2455 Meadowvale Blvd",
"city": "Mississauga",
"province": "ON",
"postalCode": "L5N 0H1",
"country": "CA"
},
"dimensions": {
"length": 1,
"width": 1,
"height": 1,
"dimensionUnit": "INCH"
},
"weight": {
"value": 1,
"weightUnit": "LB"
},
"status": "DRAFT",
"note": "Gift Box",
"createdAt": "2025-07-30T18:32:11.455Z",
"updatedAt": "2025-07-30T18:32:11.899Z",
"rates": {
"postageType": "NEXT DAY",
"postageFee": 4.88,
"tax": 0.63,
"total": 5.51,
"currency": "CAD"
},
"shipmentLineItems": [
{
"description": "T-shirt",
"quantity": 1,
"unit_value": 10,
"currency": "CAD"
}
]
}
}创建货件
Creates a new shipment in DRAFT status. The shipment must be purchased separately before a label can be generated.
curl --request POST \
--url https://api.ship.uniuni.com/prod/client/shipments/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipient": {
"name": "Jane Doe",
"phone": "+1-604-123-4567",
"email": "jane@example.com",
"signature": false
},
"address": {
"address1": "3460 Cawthra Road",
"city": "Mississauga",
"province": "ON",
"postalCode": "L5A 2Y1",
"country": "CA"
},
"dimensions": {
"length": 1,
"width": 1,
"height": 1,
"dimensionUnit": "INCH"
},
"weight": {
"value": 1,
"weightUnit": "LB"
},
"postageType": "STANDARD",
"note": "Gift Box",
"shipmentLineItems": [
{
"description": "T-shirt",
"quantity": 1,
"unit_value": 10,
"currency": "CAD"
}
]
}
'import requests
url = "https://api.ship.uniuni.com/prod/client/shipments/create"
payload = {
"recipient": {
"name": "Jane Doe",
"phone": "+1-604-123-4567",
"email": "jane@example.com",
"signature": False
},
"address": {
"address1": "3460 Cawthra Road",
"city": "Mississauga",
"province": "ON",
"postalCode": "L5A 2Y1",
"country": "CA"
},
"dimensions": {
"length": 1,
"width": 1,
"height": 1,
"dimensionUnit": "INCH"
},
"weight": {
"value": 1,
"weightUnit": "LB"
},
"postageType": "STANDARD",
"note": "Gift Box",
"shipmentLineItems": [
{
"description": "T-shirt",
"quantity": 1,
"unit_value": 10,
"currency": "CAD"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
recipient: {
name: 'Jane Doe',
phone: '+1-604-123-4567',
email: 'jane@example.com',
signature: false
},
address: {
address1: '3460 Cawthra Road',
city: 'Mississauga',
province: 'ON',
postalCode: 'L5A 2Y1',
country: 'CA'
},
dimensions: {length: 1, width: 1, height: 1, dimensionUnit: 'INCH'},
weight: {value: 1, weightUnit: 'LB'},
postageType: 'STANDARD',
note: 'Gift Box',
shipmentLineItems: [{description: 'T-shirt', quantity: 1, unit_value: 10, currency: 'CAD'}]
})
};
fetch('https://api.ship.uniuni.com/prod/client/shipments/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ship.uniuni.com/prod/client/shipments/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'recipient' => [
'name' => 'Jane Doe',
'phone' => '+1-604-123-4567',
'email' => 'jane@example.com',
'signature' => false
],
'address' => [
'address1' => '3460 Cawthra Road',
'city' => 'Mississauga',
'province' => 'ON',
'postalCode' => 'L5A 2Y1',
'country' => 'CA'
],
'dimensions' => [
'length' => 1,
'width' => 1,
'height' => 1,
'dimensionUnit' => 'INCH'
],
'weight' => [
'value' => 1,
'weightUnit' => 'LB'
],
'postageType' => 'STANDARD',
'note' => 'Gift Box',
'shipmentLineItems' => [
[
'description' => 'T-shirt',
'quantity' => 1,
'unit_value' => 10,
'currency' => 'CAD'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ship.uniuni.com/prod/client/shipments/create"
payload := strings.NewReader("{\n \"recipient\": {\n \"name\": \"Jane Doe\",\n \"phone\": \"+1-604-123-4567\",\n \"email\": \"jane@example.com\",\n \"signature\": false\n },\n \"address\": {\n \"address1\": \"3460 Cawthra Road\",\n \"city\": \"Mississauga\",\n \"province\": \"ON\",\n \"postalCode\": \"L5A 2Y1\",\n \"country\": \"CA\"\n },\n \"dimensions\": {\n \"length\": 1,\n \"width\": 1,\n \"height\": 1,\n \"dimensionUnit\": \"INCH\"\n },\n \"weight\": {\n \"value\": 1,\n \"weightUnit\": \"LB\"\n },\n \"postageType\": \"STANDARD\",\n \"note\": \"Gift Box\",\n \"shipmentLineItems\": [\n {\n \"description\": \"T-shirt\",\n \"quantity\": 1,\n \"unit_value\": 10,\n \"currency\": \"CAD\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ship.uniuni.com/prod/client/shipments/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipient\": {\n \"name\": \"Jane Doe\",\n \"phone\": \"+1-604-123-4567\",\n \"email\": \"jane@example.com\",\n \"signature\": false\n },\n \"address\": {\n \"address1\": \"3460 Cawthra Road\",\n \"city\": \"Mississauga\",\n \"province\": \"ON\",\n \"postalCode\": \"L5A 2Y1\",\n \"country\": \"CA\"\n },\n \"dimensions\": {\n \"length\": 1,\n \"width\": 1,\n \"height\": 1,\n \"dimensionUnit\": \"INCH\"\n },\n \"weight\": {\n \"value\": 1,\n \"weightUnit\": \"LB\"\n },\n \"postageType\": \"STANDARD\",\n \"note\": \"Gift Box\",\n \"shipmentLineItems\": [\n {\n \"description\": \"T-shirt\",\n \"quantity\": 1,\n \"unit_value\": 10,\n \"currency\": \"CAD\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ship.uniuni.com/prod/client/shipments/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"recipient\": {\n \"name\": \"Jane Doe\",\n \"phone\": \"+1-604-123-4567\",\n \"email\": \"jane@example.com\",\n \"signature\": false\n },\n \"address\": {\n \"address1\": \"3460 Cawthra Road\",\n \"city\": \"Mississauga\",\n \"province\": \"ON\",\n \"postalCode\": \"L5A 2Y1\",\n \"country\": \"CA\"\n },\n \"dimensions\": {\n \"length\": 1,\n \"width\": 1,\n \"height\": 1,\n \"dimensionUnit\": \"INCH\"\n },\n \"weight\": {\n \"value\": 1,\n \"weightUnit\": \"LB\"\n },\n \"postageType\": \"STANDARD\",\n \"note\": \"Gift Box\",\n \"shipmentLineItems\": [\n {\n \"description\": \"T-shirt\",\n \"quantity\": 1,\n \"unit_value\": 10,\n \"currency\": \"CAD\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Shipment created successfully",
"code": 0,
"data": {
"orderNumber": "UNI031455E90",
"trackingId": "UR07300000000005351",
"recipient": {
"name": "Jane Doe",
"phone": "+1-604-123-4567",
"email": "jane@example.com"
},
"address": {
"address1": "2455 Meadowvale Blvd",
"city": "Mississauga",
"province": "ON",
"postalCode": "L5N 0H1",
"country": "CA"
},
"dimensions": {
"length": 1,
"width": 1,
"height": 1,
"dimensionUnit": "INCH"
},
"weight": {
"value": 1,
"weightUnit": "LB"
},
"status": "DRAFT",
"note": "Gift Box",
"createdAt": "2025-07-30T18:32:11.455Z",
"updatedAt": "2025-07-30T18:32:11.899Z",
"rates": {
"postageType": "NEXT DAY",
"postageFee": 4.88,
"tax": 0.63,
"total": 5.51,
"currency": "CAD"
},
"shipmentLineItems": [
{
"description": "T-shirt",
"quantity": 1,
"unit_value": 10,
"currency": "CAD"
}
]
}
}shipmentLineItems 为必填项。 每个货件必须包含至少一个物品(shipmentLineItems 数组需包含 >= 1 个元素)。省略该字段或发送空数组将返回 422 PayloadValidationError 错误。shipmentLineItems中的每个物品还必须包含hs_code、country_of_origin以及标识制造商的description。缺少此信息的货件可能会在边境被扣留。授权
API access token generated from the UniUni Platform dashboard.
请求体
Recipient details. Provide phone, email, or both.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Preferred postage type. Domestic shipments typically use SAME DAY, NEXT DAY, or STANDARD. Cross-border CA→US shipments use USPS Ground Advantage (DDP) or PostNL International Packet Tracked (DDU). If the requested type is unavailable, an available type is selected automatically.
PUBLICATION, SAME DAY, NEXT DAY, STANDARD, USPS Ground Advantage, PostNL International Packet Tracked, OTHER Line items describing the contents. Must contain at least one item.
1Show child attributes
Show child attributes
Package dimensions. Provide either dimensions or packagingId, not both. If neither is provided, a saved default packaging preset will be used. If there are no saved packaging presets, dimensions are required.
Show child attributes
Show child attributes
ID of a pre-configured packaging profile. Use instead of dimensions if the package matches a saved profile.
Optional note, up to 200 characters.
200Whether parcel protection (insurance) is required for this shipment.
Optional client-provided order reference.
此页面对您有帮助吗?