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.

Things to Consider

  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:
    • If the initial request returned no response at all, use the Retry Shipment API to check whether the label exists. If it does not, issue a new Create Shipment request with a new Transaction ID.
    • If the initial request returned the HTTP 500 error, follow the steps in Troubleshoot the 500 Internal Server Error.
    • If the initial request returned an error other than the HTTP 500 error, you cannot reprint the label but must instead issue a new Create Shipment request with a new Transaction ID.
  2. The carrier query parameter is optional if the carrier is USPS. The query parameter is required for all other carriers.
  3. PB Standard: If you used APAC Services to print the original label, you cannot use this operation.
  4. CBDS: For the First-Mile Inclusive solution, this API returns the first-mile label. For the First-Mile Exclusive solution, this API returns the original Create Shipment response.
  5. Standard Return: If the original request returned a QR code, this API also returns a QR code.

Request URIs

Sandbox: https://api-sandbox.pitneybowes.com/shippingservices/v1/shipments/{shipmentId}?carrier={carrier}
Production: https://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

The name of the carrier. The carrier query parameter is optional if the carrier is USPS. The query parameter is required for all other carriers.

Valid values are:

  • USPS
  • Newgistics (PB Standard)
  • PBPresort
  • PBI (CBDS)
  • FedEx
  • UPS

The values are not case-sensitive.

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

The response returns a Shipment Object. The following table describes all possible fields in a Shipment Object.

Important

Some fields might not apply to your operation.

Name Data Type Description
fromAddress Address Object

Required. Origin address.

If you want a different address to appear on the label from the one listed here, see How do I print a return address that is different from the origin address?

toAddress Address Object

Required. Destination address.

FedEx, UPS: If you are shipping with FedEx or UPS to Puerto Rico or an international destination, and if the importer is different from the final recipient, this is the address of the importer. Enter the recipient’s address in the soldToAddress object. If importer’s address is the same as the final recipient, the toAddress and soldToAddress must match.

altReturnAddress Address Object

Applies only to the following:

  • USPS: If you are sending an international shipment through USPS and if you have set the NON_DELIVERY_OPTION shipment option to redirect, then enter the address that a returned parcel should go to.
  • CBDS: For a Create Shipment request, this is the address used to return a parcel from the Pitney Bowes consolidation center. If omitted, the fromAddress is used. The altReturnAddress is not returned in the response.
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]

Conditional. Defines the label, manifest, or other shipping document created by the API call.

This field is required except in the following cases:

  • This field does not apply to Rate Parcel requests.
  • This field does not apply to CBDS First-Mile Exclusive shipments.
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 any additional requirements for a carrier or service, please see the Things to Consider section on the carrier’s Create Shipment page.

        name String The name of the shipment option.
        value String The value of the shipment option.
customs Object

Conditional. For shipments that use customs forms, this object contains the customs information. This field is required for the following carriers in the following situations:

  • USPS: Required for shipments to international destinations and to APO/FPO/DPO, Territories/Possessions, and FAS
  • 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
        customsInfo Customs Info Object Customs clearance information used to fill out a commercial invoice.
        customsItems Array[Customs Items Object]

Information about each commodity in the shipment, used for customs clearance.

The maximum number of objects in this array is 30.

domesticShipmentDetails Domestic Shipment Details Object CBDS Only. Required if the merchant uses the CBDS First-Mile Exclusive solution. Contains information about the domestic leg of the shipment. This field does not apply to the First-Mile Inclusive solution.
soldToAddress Address Object

Applies only to FedEx and UPS. This contains the final recipient of a United Parcel Service shipment. Required for a shipment from the U.S. to Puerto Rico or to an international destination. 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.

shipmentType String Return Labels Only. Set this to RETURN. Required for Expedited, Standard, and Scan-Based returns.
references Array[Object]

Enters shipper-generated values. Applies only to the following:

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:

USPS Sample Reprint Request

USPS Sample Reprint Request
curl -X GET .../v1/shipments/USPS2200171406955211 \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
USPS 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 (Newgistics) Sample Reprint Request

PB Standard Sample Reprint Request
curl -X GET .../v1/shipments/NEWGISTICS2200171328057769?carrier=Newgistics \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
PB Standard Sample Reprint Response
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": { ... },
    "rates": [ ... ],
    "documents": [ {
        "type": "SHIPPING_LABEL",
        "contentType": "URL",
        "fileFormat": "PDF",
        "contents": "https://.../newgistics/904011236/outbound/label/2de2104c18de4110885a348fded42939.pdf"
    } ],
    "shipmentOptions": [ ... ],
    "shipmentId": "NEWGISTICS2200171328057769",
    "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 request for a First-Mile Inclusive shipment. The response returns the 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 PB Shipping APIs error codes, please see Error Codes.