Retry a Shipment

HTTP Request

GET /v1/shipments?originalTransactionId={id}&carrier={carrier}

Summary

If a Create Shipment request received no response or returned the HTTP 500 error, this operation checks whether the request succeeded and the label exists. If the label exists, the operation returns the label, except as noted in the Considerations. If the label does not exist, the API returns an error message and you must create a new shipment with a new Transaction ID.

Important

If your Create Shipment request returned the 500 Internal Server Error, see Troubleshoot the 500 Internal Server Error for a Create Shipment Request before using this API operation.

Important

The number of retries of a label is scrutinized and restricted.

Considerations

  1. Use this operation in the following situations:

  2. You can retrieve a label with the Retry Shipment API for up to 24 hours after the initial request to create the shipment.

  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?originalTransactionId={id}&carrier={carrier}
Production: https://shipping-api.pitneybowes.com/shippingservices/v1/shipments?originalTransactionId={id}&carrier={carrier}

Query Parameters

Name

Description

originalTransactionId

Required. The X-PB-TransactionId that was used when the original shipment was submitted.

carrier

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

Valid values are:

  • USPS: PB Expedited (default)

  • PBCS: PB Standard

  • PBPresort

  • PBI: PB Cross-Border Delivery Service (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

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

This section contains examples for the following carriers:

PB Expedited (USPS) Sample Retry Request

PB Expedited Sample Retry Request
curl -X GET ".../v1/shipments?originalTransactionId=12345678901234567890" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
PB Expedited Sample Retry Response
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": { ... },
    "rates": [ ... ],
    "shipmentId": "USPS2200070298237396",
    "parcelTrackingNumber": "9405509898641491051189",
    "documents": [ {
        "fileFormat": "PDF",
        "contentType": "URL",
        "contents": "https://.../usps/872060188/outbound/label/208b56a6d2b84baeaa18dc23075bc1b4.pdf"
    } ],
    "shipmentOptions": [ ... ]
}

PB Standard Delivery Sample Retry Request

PB Standard Delivery Sample Retry Request
curl -X GET ".../v1/shipments?originalTransactionId=n6721a207a60867e6176&carrier=PBCS" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
PB Standard Delivery Sample Retry Response
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": { ... },
    "rates": [ ... ],
    "documents": [ {
        "type": "SHIPPING_LABEL",
        "contentType": "BASE64",
        "fileFormat": "ZPL2",
        "pages": [ {
            "contents": "XMwxNX5..."
        } ]
    } ],
    "shipmentOptions": [ ... ],
    "shipmentId": "NGST2200115577794836",
    "parcelTrackingNumber": "4200651192612123456789000000225251"
}

PB Presort Sample Retry Request

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

CBDS Sample Retry Request

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

FedEx Sample Retry Request

FedEx Sample Retry Request
curl -X GET ".../v1/shipments?originalTransactionId=21675246742&carrier=fedex" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
FedEx Sample Retry Response
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": { ... },
    "rates": [ ... ],
    "documents": [ {
        "contentType": "URL",
        "contents": "https://.../52823dd60d354562a08533aa6cd98862.pdf",
        "fileFormat": "PDF",
        "size": "DOC_4X6"
    } ],
    "shipmentOptions": [ ... ],
    "parcelTrackingNumber": "79468785464190",
    "shipmentId": "FEDEX220216078962794"
}

UPS Sample Retry Request

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

Error Codes

The following error codes are specific to this API:

Error Code

Message

1090001

Original Transaction not found.

1090006

Time limit has passed.

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