createManifest()

This method creates an end-of-day manifest and should be implemented by carrier apps that support end-of-day manifesting.

Syntax

module.exports = async function createManifest(transaction, manifest) {
// Your code here
}
import { Transaction, NewManifest, ManifestConfirmation } from "@shipengine/connect";
export default async function createManifest(
transaction: Transaction,
manifest: NewManifest
): Promise<ManifestConfirmation> {
// Your code here
}

Parameters

transaction

A transaction object containing information about the transaction and session state.

manifest

An object containing information needed to create a new end-of-day manifest.

NameTypeNullable?Description
openDateTime

date/time object

The start-of-day time, or the manifestDateTime of the earliest manifest being manifested.

closeDateTime

date/time object

The end-of-day time, or the manifestDateTime of the latest manifest being manifested.

shipmentsobject[]

This shipments in the manifest. The meaning of this field varies depending on the carrier's manifestShipments setting.

  • all_shipments - This field must include all shipments that have not yet been manifested.
  • explicit_shipments - This field specifies which shipments should be manifested.
  • exclude_shipments - This field specifies which shipments should not be manifested. All other shipments will be manifested.
shipments[]   .trackingNumberstring

The master tracking number for the entire shipment. For single-piece shipments, this will be the same as the package tracking number. For multi-piece shipments, this may be a separate tracking number, or the same tracking number as one of the packages. This string will not contain newline characters.

shipments[].identifiers

identifiers object

Your own identifiers for this shipment.

shipments[]   .deliveryService

delivery service object

The delivery service assigned to this shipment.

shipments[].metadataobject

Custom data about this shipment that was previously persisted by the ShipEngine Platform.

shipments[].packagesobject[]

The list of packages in this shipment. This array will contain at least one value.

shipments   .packages[]   .trackingNumberstring

The master tracking number for the entire shipment. For single-piece shipments, this will be the same as the package tracking number. For multi-piece shipments, this may be a separate tracking number, or the same tracking number as one of the packages. This string will not contain newline characers.

shipments[]   .packages[]   .identifiers

identifiers object

Your own identifiers for this package.

shipments[]   .packages[]   .packagingobject

The packaging used for this package.

shipments[]   .packages[]   .packaging   .id

UUID

A UUID that uniquely identifies this packaging. This is the UUID you used in the Packaging Definition file for this packaging type.

shipments[]   .packages[]   .packaging   .identifiers

identifiers object

Your own identifiers for this packaging.

shipments[]   .packages[]   .packaging[]   .codestring

Optional code used to map to what the carrier uses to identify the packaging.

The value custom indicates user-defined packaging. Some of our products allow users to enter custom packaging instead of one of your app's pre-defined packaging types.

shipments[]   .packages[]   .dimensionsobject

The dimensions for the package.

This property is not required. If it is provided, it must contain all of its required properties, listed below.

shipments[]   .packages[]   .dimensions   .lengthnumber

The length of the package. This value may contain decimals.

shipments[]   .packages[]   .dimensions   .widthnumber

The width of the package. This value may contain decimals.

shipments[]   .packages[]   .dimensions   .heightnumber

The height of this package. This value may contain decimals.

shipments[]   .packages[]   .dimensions   .unitstring

The unit of measurement for the dimensions. Valid values include the following:

  • in for inches
  • cm for centimeters
shipments[]   .packages[]   .weightobject

The weight of the package.

This property is not required. If it is provided, it must contain all of its required properties, listed below.

shipments[]   .packages[]   .weight   .valuenumber

The weight value for this package. This value will not contain decimals.

shipments[]   .packages[]   .weight   .unitstring

The unit of measure for this weight. Valid values include the following:

  • g for grams
  • oz for ounces
  • kg for kilograms
  • lb for pounds
shipments[]   .packages[]   .metadataobject

Custom data about this package that was persisted by ShipEngine Connect. Must be JSON serializable.

shipments[].packageobject

The first package in the packages array. This is useful for carriers that only support single-piece shipments. This object has all the same properties as the objects in the packages array described above.

shipFrom

address object

The address of the location that is performing end-of-day manifesting. This field is required if the carrier's manifestLocations setting is single_location in the Carrier Definition file.

Return Value

manifestConfirmation

An object that contains confirmation that an end-of-day manifest has been created.

NameTypeRequired?Description
manifestsobject[]

An object containing information about this manifest, including the shipments that are included. If not specified, the assumption is that the manifest includes all of the shipments.

manifests[].shipmentsobject[]

The shipments that are included in this manifest.

manifests[]   .shipments[]   .trackingNumberstring

The master tracking number for the entire outbound shipment. For single-piece shipments, this will be the same as the package tracking number. For multi-piece shipments, this may be a separate tracking number, or the same tracking number as one of the packages. This string must not contain newline characters.

manifests[]   .shipments[]   .identifiers

identifiers object

Your own identifiers for this shipment.

manifests[].idstring

The carrier's manifest ID, if any. This string must not contain newline characters.

manifests[].identifiers

identifiers object

Your own identifiers for this manifest.

manifests[].documentobject

The digital manifest document, such as a PDF SCAN form.

This property is not required. If it is provided, it must contain all of its required properties, listed below.

manifests[].document.namestring

The user-friendly name of the document (e.g. "Label", "Customs Form"). This string must not contain newline characters.

manifests[].document.typestring

The type of document (e.g. label, customs form, SCAN form). Valid values include the following:

  • label - label
  • customs_form - customs form
  • scan_form - SCAN form
manifests[].document.sizestring

The size of document (e.g. label, customs form, SCAN form). Valid values include the following:

  • A4- A4 sized paper ( 8.27 inches x 11.69 inches)
  • letter - Letter sized paper (8.5 inches by 11 inches)
  • 4x6 - Paper sized 4 inches by 6 inches
  • 4x8 - Paper sized 4 inches by 8 inches
manifests[]   .document   .formatstring

The file format of the document. Valid values include the following:

  • pdf - Portable Document Format (PDF)
  • zpl - Zebra Printer Label (ZPL)
  • png - Portable Graphics Format (PNG)
manifests[].document.data

Buffer object

The document data, in the specified file format.

manifests[].notesobject[]

An array of objects containing additional information about this manifest.

This property is not required. If it is provided, it must contain all of its required properties, listed below.

manifests[].notes[].type

notes type string

The type for this note.

manifests[].notes[].textstring

The note text itself.

manifests[].metadataobject

Your custom data about this manifest that will be persisted by the ShipEngine Connect. Must be JSON serializable.

manifests[].idstring

The carrier's manifest ID, if any. This string must not contain newline characters.

manifests[].identifiers

identifiers object

Your own identifiers for this manifest.

notManifestedobject[]

An array of the shipments that could not be manifested, and the reason each shipment was not manifested.

This property is not required. If it is provided, it must contain all of its required properties, listed below.

notManifested[]   .trackingNumberstring

The master tracking number for the entire shipment. For single-piece shipments, this will be the same as the package tracking number. For multi-piece shipments, this may be a separate tracking number, or the same tracking number as one of the packages. This string will not contain newline characters.

notManifested[]   .identifiers

identifiers object

Your own identifiers for this manifest.

notManifested[].codestring

The carrier's error code. This string must not contain newline characters.

notManifested[]   .descriptionstring

The carrier's description of the error code. This description should not be specific to this particular shipment. This string must not contain newline characters.

notManifested[].notesobject[]

An array of objects containing additional information about those shipments not manifested.

notManifested[]   .notes[]   .type

notes type string

The type for this note.

notManifested[]   .notes[]   .textstring

The note text itself.

Example

module.exports = async function createManifest(transaction, manifest) {
// Your Carrier's code logic goes here
}
import {
Transaction,
NewManifest,
ManifestConfirmation
} from "@shipengine/connect";
export default async function createManifest(
transaction: Transaction, manifest: NewManifest): Promise<ManifestConfirmation[]> {
// Your Carrier's code logic goes here
}