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 Delivery: If you used APAC Services to print the original label, you cannot use this operation.

  4. PB 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 Delivery

  • 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 shipments operation returns the same response elements as the POST shipments operation. For the response elements, see the documentation for the original Create Shipment request.

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 Delivery Sample Reprint Request

PB Delivery Sample Reprint Request
curl -X GET ".../v1/shipments/NGST2200171328057769?carrier=PBCS" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
PB 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.