Creating a Manifest
Manifests are required by some carriers to streamline the pickup process by allowing them to process many shipments at once. Without a manifest, the carrier would need to scan each package individually. When picking up hundreds of packages from a warehouse, scanning a manifest is far more efficient than scanning each individual package.
This guide walks you through creating a daily manifest.
Get the List of Labels
The first step in creating a manifest is determining which labels to include in the manifest and the best way to specify them in your request to ShipEngine. Let's start with the simple case of creating a manifest for all labels that were created today.
To get a list of the labels that were created today, we will use the /v1/labels
endpoint
and pass some query parameters to filter the data. In this case we pass created_at_start
and created_at_end
. These parameters define a time range and allow us to get the list of labels that were created on a particular business day.
Without these parameters, this endpoint will return all labels.
Example Request
This example gets a list of all the labels that were created between the created_at_start_time
and the created_at_end_time
. It sends an HTTP GET request to the /v1/labels
endpoint and passes URL parameters
to filter the labels that are returned.
Example Response
This is an example of the response that is returned from request above. It includes two labels.
Create the Manifest
In the response above, you can see that two labels were returned. We can create an explicit manifest
that includes the two label_id
values from the response above.
Example Request
This example creates a manifest by making an HTTP POST request to the /v1/manifests
endpoint. It sets the values of
the label_ids
property to the label_id
values from the response above.
Example Response
This is an example of the response that is returned from the request above. In this case, it only returns one manifest, but it could return more than one.
Each manifest includes labels with the same
ship_date
, carrier_id
, and warehouse_id
. ShipEngine will create multiple manifests if you send labels with different
values for those properties. You might also have multiple manifests in the response if your request
includes more than 500 labels since ShipEngine only includes 500 labels per manifest.
Notice that the manifest object has an href
property that contains a URL. You can use this URL to download the manifest.
There is also a top-level href
property that is set to the href
of the first manifest if the response contains
more than one manifest. In our case, both properties contain the same value since only one manifest was created.
Download the Manifest
At this point, we've created the manifest. We now have a URL where we can download the manifest, which is a PDF file.
We can enter this value directly in a web browser to view and download the file through the browser, or we can download it programmatically.
Example Request
This example downloads the manifest using the URL returned in the response above. Notice that you
must change the Content-Type
to application/pdf
.