Reprint a Shipment Label

HTTP Request

GET /v1/shipments/{shipmentId}?carrier={carrier}

Summary

This operation retrieves an existing shipping label or QR code. The API sends the shipmentId returned by the original Create Shipment request. Use this only if the shipping label or QR code in the Create Shipment response was spoilt or lost. The APIs allow three attempts to reprint a label.

Important: Reprints should be used only in the case of spoilt or lost data. The number of reprints of a shipment label is scrutinized and restricted.

Considerations

  1. You cannot use this operation if the initial Create Shipment request returned no response or returned an error. If that’s the case, do one of the following:

  2. The carrier query parameter is optional if the original shipment used a rates.carrier value of USPS. The query parameter is otherwise required.

  3. PB Standard Delivery: If you used APAC Services to print the original label, you cannot use this operation.

  4. PB Standard Returns: If the original request returned a QR code, this API also returns a QR code.

  5. CBDS: This API returns a label only if the original Create Shipment request returned a label.

Request URLs

Sandbox: https://shipping-api-sandbox.pitneybowes.com/shippingservices/v1/shipments/{shipmentId}?carrier={carrier}
Production: https://shipping-api.pitneybowes.com/shippingservices/v1/shipments/{shipmentId}?carrier={carrier}

Path Parameter

Name

Description

shipmentId

Required. The shipment ID that was issued when shipment label was generated.

Query Parameter

Name

Description

carrier

Required for all carriers, except USPS. Enter the name of the carrier for the original shipment, as specified in the rates.carrier field of the original shipment. Valid values:

  • USPS: PB Expedited

  • PBCS: PB Standard

  • PBPresort

  • PBI: PB Cross-Border Delivery Service (CBDS)

  • FedEx

  • UPS

Request Header

Name


Description

Authorization

Required. OAuth token generated using the Generate an OAuth Token API.

X-PB-UnifiedErrorStructure

Recommended. Set this to true to use the standard error object if an error occurs.

Response Elements

This GET operation returns the Shipment object. The table below describes the object for all operations that use it. Some fields are labeled Required, which means they are required in the request for operations that send a payload. Some fields are marked as applying only to other label types. They do not apply to this operation.

Name


Data Type

Description

shipmentType

String

Return Labels Only. For return labels, set this to RETURN.

Required for Expedited Returns , Standard Returns, and when rating return labels. Note that you cannot rate Standard Returns.

Recommended for CBDS Returns.

fromAddress

Address Object

Required. Origin address.

If you want a different address to appear on the label from the one listed here, see this FAQ. The FAQ does not apply to PB Standard.

toAddress

Address Object

Required. Destination address.

If you are shipping to Puerto Rico or an international destination with FedEx or UPS, and if the importer is different from the final recipient, enter the address of the importer here in the toAddress object. For the address of the recipient, use the soldToAddress object. If the importer is the same as the final recipient, the toAddress and soldToAddress must match.

altReturnAddress

Address Object

For these carriers, sets an address for parcel returns:

  • PB Expedited: If you are sending an international shipment and if you have set the NON_DELIVERY_OPTION option to redirect, use this field to specify the address for a parcel return.

  • PB Presort

  • PMOD

  • CBDS Outbound & CBDS Domestic: By default, parcel returns are sent to a shipment’s fromAddress. (Parcel returns are sent from the CBDS Hub.) If the fromAddress is the wrong address for your returns, then you must use the altReturnAddress to enter the correct address for returns. Failure to do so will result returns to the wrong address.

  • FedEx

  • UPS

additionalAddresses

Array[Additional Addresses Object]

CBDS Returns Only. If the seller’s address is different from the toAddress, enter the seller’s address here.

Required if the toAddress and seller address are different.

parcel

Parcel Object

Required. Contains physical characteristics of the parcel.

rates

Array[Rates Object]

Required. Specifies the carrier, service, parcel, and other information. In a response, this field also contains the service charges.

Important: In a request, the rates array can contain only one rates object.

documents

Array[Documents Object]

Required, except as noted below. Defines the label, manifest, or other shipping document created by the API call. In a response, this array provides the URL or Base64 string for a document and in some cases can contain multiple objects.

This field does not apply to:
- Rate Parcel API.
- Create CBDS Shipment API if the merchant prints the first-mile label prior to invoking the API.

shipmentOptions

Array[Object]

Required. Each object in this array defines a shipment option. Specify each option as a name-value pair in the array.

The SHIPPER_ID option is required. For additional requirements for a carrier, see the Considerations section on the carrier’s Create Shipment page.

shipmentOptions.name

String

The name of the shipment option.

shipmentOptions.value

String

The value of the shipment option.

customs

Object

For shipments that use customs forms, this object contains the customs information.

Required in the following situations:

  • PB Expedited: Required for shipments to international destinations. Conditional for shipments to APO/FPO/DPO, U.S. Territories, and FAS, as explained in this FAQ.

  • CBDS: Required for all shipments.

  • FedEx: Required for shipments to international destinations and Puerto Rico.

  • UPS: Required for shipments to international destinations and Puerto Rico.

customs.customsInfo

Customs Info Object

Customs clearance information for the commercial invoice.

Required in the customs object.

customs.customsItems

Array[Customs Items Object]

Customs clearance information for each commodity.

Required in the customs object.

Maximum number of objects in the array: 30

domesticShipmentDetails

Domestic Shipment Details Object

CBDS Only. The first-mile label’s tracking number and other information about the first-mile leg.

Required if the merchant prints the first-mile label prior to invoking the API, as is the case with the Drop-Off to CBDS solution. Send the first-mile label’s tracking number and details.

RESPONSE ONLY for all other CBDS shipment requests.

references

Array[Object]

PB Standard & CBDS Only. The merchant’s reference fields. Each object in the array includes a name-value pair that defines a reference field. See the following, depending on your carrier:

To pass references for carriers other than the above, see How do I Add Reference Fields for My Carrier?

hazmatDetails

Hazmat Details Object

PB Standard Only. If shipping hazardous materials with PB Standard, use this object.

carrierPayments

Array[Shipment: Carrier Payments Object]

FedEx & UPS Only. Indicates that one or more of the shipment costs should be charged to a third-party account.

soldToAddress

Address Object

FedEx & UPS Only. The final recipient of a the shipment.

Required for shipments from the U.S. to Puerto Rico or international destinations. Otherwise optional.

This address must match the toAddress.countryCode, with the exception of shipments to Canada and to U.S. satellite countries.

If the final recipient’s address is the same as the importer’s address, the entries in the soldToAddress object must match the entries in the toAddress object.

shipmentId

String

RESPONSE ONLY. Unique identifier for the shipment, generated by the system in response to shipment purchase.

parcelTrackingNumber

String

RESPONSE ONLY. Tracking number assigned to the shipment by the system.

Sample Requests

See the following examples:

PB Expedited Sample Reprint Request

PB Expedited Sample Reprint Request
curl -X GET ../v1/shipments/USPS2200171406955211 \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
PB Expedited Sample Reprint Response
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": { ... },
    "rates": [ ... ],
    "documents": [ {
        "contentType": "URL",
        "fileFormat": "PDF",
        "contents": "https://.../usps/198715941/outbound/label/c95b3716623646178ce5e0ba574d78ff.pdf"
    } ],
    "shipmentOptions": [ ... ],
    "shipmentId": "USPS2200171406955211",
    "parcelTrackingNumber": "9405509898641490995613"
}

PB Standard Delivery Sample Reprint Request

PB Standard Delivery Sample Reprint Request
curl -X GET ../v1/shipments/NGST2200171328057769?carrier=PBCS \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
PB Standard Delivery Sample Reprint Response
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": { ... },
    "rates": [ ... ],
    "documents": [ {
        "type": "SHIPPING_LABEL",
        "contentType": "URL",
        "fileFormat": "PDF",
        "contents": "https://.../2de2104c18de4110885a348fded42939.pdf"
    } ],
    "shipmentOptions": [ ... ],
    "shipmentId": "NGST2200171328057769",
    "parcelTrackingNumber": "4206740192612123456789000000225206"
}

PB Presort Sample Reprint Request

PB Presort Sample Reprint Request
curl -X GET ../v1/shipments/PBPRESORT2200171406981881?carrier=PBPresort \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
PB Presort Sample Reprint Response
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": { ... },
    "rates": [ ... ],
    "documents": [ {
        "type": "SHIPPING_LABEL",
        "contentType": "URL",
        "fileFormat": "PDF",
        "contents": "https://.../pbpresort/904011236/outbound/label/c004299c6f524b0db59f44425fc5047e.pdf"
    } ],
    "shipmentOptions": [ ... ],
    "shipmentId": "PBPRESORT2200171406981881",
    "parcelTrackingNumber": "0070698765432100004506511253671"
}

CBDS Sample Reprint Request

The following is a sample retry request for a Create Shipment operation that had printed a first-mile label.

CBDS Sample Reprint Request
curl -X GET ../v1/shipments/UPGUS00164FC110CCA57?carrier=PBI \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
CBDS Sample Reprint Response
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": { ... },
    "rates": [ ... ],
    "documents": [ {
        "type": "SHIPPING_LABEL",
        "size": "DOC_8X11",
        "fileFormat": "PDF",
        "contentType": "URL",
        "contents": "https://.../usps/352584758/outbound/label/9d1da50f82734ad9d4a41d5fb9a19b.pdf"
    } ],
    "shipmentOptions": [ ... ],
    "customs": { ... },
    "references": [ ... ],
    "parcelTrackingNumber": "UPGUS00164FC110CCA57",
    "shipmentId": "UPGUS00164FC110CCA57"
}

FedEx Sample Reprint Request

FedEx Sample Reprint Request
curl -X GET ../shipments/FEDEX2200287696247364?carrier=fedex \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
FedEx Sample Reprint Response
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": { ... },
    "rates": [ ... ],
    "documents": [ {
        "contentType": "URL",
        "contents": "https://.../87d8a4f658864a4c829e8924f7843b46.pdf",
        "fileFormat": "PDF",
        "size": "DOC_4X6"
    } ],
    "shipmentOptions": [ ... ],
    "parcelTrackingNumber": "<tracking-number>"
    "shipmentId": "FEDEX2200287696247364"
}

UPS Sample Reprint Request

UPS Sample Reprint Request
curl -X GET ../v1/shipments/UPS2200170731892828?carrier=UPS \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
UPS Sample Reprint Response
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": { ... },
    "rates": [ ... ],
    "documents": [ {
        "size": "DOC_4X6",
        "fileFormat": "PDF",
        "contentType": "URL",
        "contents": "https://.../ups/258459135/outbound/label/2467dad3127a49048a99fa097de6535a.pdf"
    } ],
    "shipmentOptions": [ ... ],
    "shipmentId": "UPS2200170731892828",
    "parcelTrackingNumber": "<tracking-number>"
}

Error Codes

For a list of all error codes returned by the Ecommerce APIs, please see Error Codes.