Site Logo

Custom Package Types

If you have your own custom packaging with specific dimensions that you use frequently (either in place of or in addition to carrier defined packages), you might find it helpful to define those custom package types to use more easily in your shipments. You can then simply include the package_code property in your shipment object, instead of the individual dimension properties.

Define a Package Type

You can define as many package types as you need, each with their own name, package code, and set of dimensions.

Requirements

The following properties are required in the request body when creating a custom package type:

PropertyTypeDescription
package_codestringMax 50 characters. This is the code you will use in your shipment objects. Each custom package must add the prefix custom_ to the package_code or the request will be rejected with a HTTP 400, Bad Request status.
namestringMax 50 characters. Any custom name you choose to help identify the package.
dimensionsObjectRequires the unit, length, width, and height properties

Optional Properties

You can also include a package_id, which is a string (max 25 characters) that uniquely identifies the package, and a description, a string of up to 500 characters.

Example Request & Response

POST /v1/packages/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
POST /v1/packages HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
Content-Type: application/json
{
"package_code": "custom_laptop_box",
"name": "laptop_box",
"dimensions": {
"unit": "inch",
"length": 15,
"width": 20,
"height": 5
},
"description": "Packaging for laptops."
}

Response

The response will simply include all of the packages defined properties.

1
2
3
4
5
6
7
8
9
10
11
12
{
"package_id": "se-100896",
"package_code": "custom_laptop_box",
"name": "laptop_box",
"dimensions": {
"unit": "inch",
"length": 15.0,
"width": 20.0,
"height": 5.0
},
"description": "Packaging for laptops."
}

List Package Types

List your package types to get a response with an array of all the available custom packaging available in your account.

Example Request & Response

GET /v1/packages

1
2
3
GET /v1/packages HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"packages": [
{
"package_id": "se-102873",
"package_code": "custom_laptop_box",
"name": "Custom Laptop Box",
"dimensions": {
"unit": "inch",
"length": 15.00,
"width": 20.00,
"height": 5.00
},
"description": ""
}
]
}

Delete Package Types

Deleting a package will not disassociate it from any shipments. It will merely stop being available for use with future shipments and it will will no longer be included in the list packages response.

You will need the package_id of the custom package you wish to delete.

Example Request & Response

DELETE /v1/packages/:package_id

1
2
3
DELETE /v1/packages/se-102873 HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__

Response

If successful, you'll receive an HTTP Status 204, No Content response.