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¶
Use this operation in the following situations:
If the original Create Shipment request received no response at all and gave no indication of success or failure.
If your request returned the HTTP 500 Internal Server Error and you have followed the steps in Troubleshoot the 500 Internal Server Error for a Create Shipment Request.
You can retrieve a label with the Retry Shipment API for up to 24 hours after the initial request to create the shipment.
PB Delivery: If you used APAC Services to print the original label, you cannot use this operation.
PB Returns: If the original request returned a QR code, this API also returns a QR code.
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 |
carrier |
The name of the carrier. The Valid values are:
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 |
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¶
curl -X GET ".../v1/shipments?originalTransactionId=12345678901234567890" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
{
"fromAddress": { ... },
"toAddress": { ... },
"parcel": { ... },
"rates": [ ... ],
"shipmentId": "USPS2200070298237396",
"parcelTrackingNumber": "9405509898641491051189",
"documents": [ {
"fileFormat": "PDF",
"contentType": "URL",
"contents": "https://.../usps/872060188/outbound/label/208b56a6d2b84baeaa18dc23075bc1b4.pdf"
} ],
"shipmentOptions": [ ... ]
}
PB Delivery Sample Retry Request¶
curl -X GET ".../v1/shipments?originalTransactionId=n6721a207a60867e6176&carrier=PBCS" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
{
"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¶
curl -X GET ".../v1/shipments?originalTransactionId=prs71480691704c91815&carrier=PBPresort" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
{
"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¶
curl -X GET ".../v1/shipments?originalTransactionId=123456789012345678&carrier=PBI" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
{
"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¶
curl -X GET ".../v1/shipments?originalTransactionId=21675246742&carrier=fedex" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
{
"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¶
curl -X GET ".../v1/shipments?originalTransactionId=4e01a996dc2060f188&carrier=ups" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"
{
"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.