Using Custom Packages

Example

POST /v1/shipments

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
44
45
46
47
48
49
50
51
52
POST /v1/shipments HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
Content-Type: application/json
{
"shipments": [
{
"service_code": "usps_priority_mail",
"shipment_status": "pending",
"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",
"advanced_options": {},
"insurance_provider": "none",
"tags": [],
"total_weight": {
"value": 10.0,
"unit": "ounce"
},
"packages": [
{
"package_code": "custom_laptop_box",
"weight": {
"value": 10.0,
"unit": "ounce"
}
}
]
}
]
}

In the request we simply added to the packages collection:

1
2
3
{
"package_code": "custom_laptop_box"
}

In the response we see, it worked!

1
2
3
4
5
6
7
8
9
{
"package_code": "custom_laptop_box",
"dimensions": {
"unit": "inch",
"length": 15.00,
"width": 20.00,
"height": 5.00
}
}