Site Logo

🎉 ShipEngine is becoming ShipStation API 🎉

Over the next few months you'll notice the ShipEngine website, documentation portal, and dashboard being rebranded as ShipStation API. For our ShipEngine customers, you don't need to take any action or change any of your integrations in any way. All endpoints will remain the same and continue to function as they always have.

To learn more about what's coming, review our New ShipStation API page.

Carrier Packaging

Most carriers support their own package types, each with a specific package_id and package_code that you define in the packages object for a shipment. While the package_id and package_code properties are not required by ShipStation API, most carriers will require at least the package_code to successfully return a label. Additionally, the carrier package you use can affect things like your rate (e.g., a USPS Flat Rate box will have a different rate than a generic package).

To see what types of packages your carrier supports and the associated properties, you can use the list carrier packages request.

Carrier packaging is distinct from using custom package types, which are custom packages where you define the package properties in advance, including dimensions, and only add the package_code to the packages object.

Example Request

This create label example uses the USPS Priority Mail service with a medium flat rate box package type. In the case of flat rate boxes, you will declare package weight (to ensure the shipment does not exceed the flat rate maximum) but would not declare package dimensions.

POST /v1/labels/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
POST /v1/labels HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
Content-Type: application/json
{
"shipment": {
"packages": [
{
"package_code": "medium_flat_rate_box",
"weight": {
"value": 9.6,
"unit": "ounce"
}
}
],
"service_code": "usps_priority_mail",
"ship_to": {
"name": "Amanda Miller",
"phone": "555-555-5555",
"address_line1": "525 S Winchester Blvd",
"city_locality": "San Jose",
"state_province": "CA",
"postal_code": "95128",
"country_code": "US",
"address_residential_indicator": "yes"
},
"ship_from": {
"company_name": "Example Corp.",
"name": "John Doe",
"phone": "111-111-1111",
"address_line1": "4009 Marathon Blvd",
"address_line2": "Suite 300",
"city_locality": "Austin",
"state_province": "TX",
"postal_code": "78756",
"country_code": "US",
"address_residential_indicator": "no"
},
"confirmation": "none",
"insurance_provider": "none"
}
}

In the creat label response, the package_code property will be a property in both the shipment object and the packages object. In the create shipment response, the package_code property will be in the packages object only.