Reprint a Shipment Label

HTTP Request

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

Summary

This operation retrieves an existing shipping label using the shipmentId returned by the original Create Shipment request. Use this only if the shipping label portion of 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 labels. 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:
  2. The carrier query parameter is optional if the carrier is USPS. The query parameter is required for all other carriers.

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
  • PBPresort
  • 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

Important

The response returns a Shipment Object. The following table describes all possible fields in a Shipment Object. 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.

Note for UPS: If you are shipping with United Parcel Service (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.
  • PB Cross-Border: 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.
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 shipment document. Applies as follows:

  • Required for Create Shipment requests except as noted in the next bullet.
  • Does not apply to a Cross-Border Create Shipment request.
  • Does not apply to Rate Parcel requests.
shipmentOptions Array[Object] Conditional. Each object in this array defines a shipment option. Required for Create Shipment requests. Does not apply to Rate Parcel requests. All Create Shipment requests require the SHIPPER_ID option. Please see the Things to Consider section on the carrier’s Create Shipment page for any additional requirements.
        name String The name of the shipment option. The shipmentOptions array requires this field.
        value String The value of the shipment option. The shipmentOptions array requires this field.
customs Object

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

  • USPS shipments to international destinations and to APO/FPO/DPO, Territories/Possessions, and FAS
  • PB Cross-Border
  • UPS 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 PB Cross-Border Only. Required in Create Shipment requests; does not apply to Rate Parcel requests. Contains information about the domestic leg of the PB Cross-Border shipment.
soldToAddress Address Object

UPS Only. 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 USPS Return Labels Only. Required for USPS Return Labels. If you are creating a Pure Post Return label or Scan-Based Return label, include this field and set the value to RETURN.
references Array[Object]

Applies only to the following:

  • PB Cross-Border: Required in a Create Shipment request; does not apply to a Rate Parcel request. Contains the buyer order ID. The array takes an object with two String elements. Set name to ORDER_NUMBER, and set value to the order ID:

    {
        "name": "ORDER_NUMBER",
        "value": "<order_ID>"
    }
    
  • Newgistics: Optional. This array maps client-generated identifiers to fields in the Newgistics package record. The information in this array does not appear on the shipping label. The array takes up to three objects, and each object maps an identifier to a specific Newgistics field. An object’s sequence in the array determines which Newgistics field the object maps to. The first object in the array maps to the Newgistics “ReferenceNumber” field; the second to the “AddlRef1” field; and the third to the “AddlRef2” field.

    Use the syntax shown below. Enter the names in the order shown. If you enter different names, the system will change them to the names below. In the value fields, enter the client-generated identifiers. The values must be strings of no more than 50 characters each. For additional information on using references, merchants can contact their Newgistics representatives.

    {
        "name": "ReferenceNumber",
        "value": "<client identifier 1>"
    }, {
        "name": "AddlRef1",
        "value": "<client identifier 2>"
    }, {
        "name": "AddlRef2",
        "value": "<client identifier 3>"
    }
    
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 Request

curl -X GET .../v1/shipments/USPS2200171406955211 \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"

USPS Sample Response

{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": {
        "weight": {
            "weight": 12,
            "unitOfMeasurement": "OZ"
        },
        "dimension": {
            "unitOfMeasurement": "IN",
            "length": 8,
            "width": 4,
            "height": 6,
            "irregularParcelGirth": 0
    },
    "rates": [ {
        "carrier": "USPS",
        "parcelType": "PKG",
        "specialServices": [ {
            "specialServiceId": "DelCon",
            "inputParameters": [ {
                "name": "INPUT_VALUE",
                "value": "0"
            } ],
            "fee": 0
        } ],
        "serviceId": "PM",
        "rateTypeId": " <rate-type-ID> ",
        "deliveryCommitment": {
            "minEstimatedNumberOfDays": "1",
            "maxEstimatedNumberOfDays": "1",
            "estimatedDeliveryDateTime": "2018-06-09",
            "guarantee": "NONE",
            "additionalDetails": "By end of Day"
        },
        "baseCharge": 5.95,
        "totalCarrierCharge": 5.95,
        "currencyCode": "USD"
    } ],
    "documents": [ {
        "contentType": "URL",
        "fileFormat": "PDF",
        "contents": "https://.../usps/198715941/outbound/label/c95b3716623646178ce5e0ba574d78ff.pdf"
    } ],
    "shipmentOptions": [ {
        "name": "HIDE_TOTAL_CARRIER_CHARGE",
        "value": "false"
    }, {
        "name": "SHIPPER_ID",
        "value": "9024324564"
    }, {
        "name": "ADD_TO_MANIFEST",
        "value": "true"
    }, {
        "name": "FUTURE_SHIPMENT_DATE",
        "value": "2018-06-08"
    } ],
    "shipmentId": "USPS2200171406955211",
    "parcelTrackingNumber": "9405509898641490995613"
}

Newgistics Sample Request

curl -X GET .../v1/shipments/NEWGISTICS2200171328057769?carrier=Newgistics \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"

Newgistics Sample Response

{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": {
        "weight": {
            "unitOfMeasurement": "OZ",
            "weight": 32
        },
        "dimension": {
            "unitOfMeasurement": "IN",
            "length": 8,
            "width": 4,
            "height": 6,
            "irregularParcelGirth": 0
    },
    "rates": [ {
        "carrier": "NEWGISTICS",
        "parcelType": "PKG",
        "specialServices": [ {
            "specialServiceId": "DelCon",
            "inputParameters": []
        } ],
        "serviceId": "PRCLSEL"
    } ],
    "documents": [ {
        "type": "SHIPPING_LABEL",
        "contentType": "URL",
        "fileFormat": "PDF",
        "contents": "https://.../newgistics/904011236/outbound/label/2de2104c18de4110885a348fded42939.pdf"
    } ],
    "shipmentOptions": [ {
        "name": "SHIPPER_ID",
        "value": "9024324564"
    }, {
        "name": "CLIENT_FACILITY_ID",
        "value": "0093"
    }, {
        "name": "CARRIER_FACILITY_ID",
        "value": "1585"
    } ],
    "shipmentId": "NEWGISTICS2200171328057769",
    "parcelTrackingNumber": "4206740192612123456789000000225206"
}

PB Presort Sample Request

curl -X GET .../v1/shipments/PBPRESORT2200171406981881?carrier=PBPresort \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"

PB Presort Sample Response

{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": {
        "weight": {
            "unitOfMeasurement": "OZ",
            "weight": 3
        },
        "dimension": {
            "unitOfMeasurement": "IN",
            "length": 12,
            "width": 0.25,
            "height": 8,
            "irregularParcelGirth": 0
        }
    },
    "rates": [ {
        "carrier": "PBPRESORT",
        "parcelType": "LGENV",
        "serviceId": "BPM",
        "baseCharge": 0,
        "totalCarrierCharge": 0,
        "currencyCode": "USD"
    } ],
    "documents": [ {
        "type": "SHIPPING_LABEL",
        "contentType": "URL",
        "fileFormat": "PDF",
        "contents": "https://.../pbpresort/904011236/outbound/label/c004299c6f524b0db59f44425fc5047e.pdf"
    } ],
    "shipmentOptions": [ {
        "name": "PERMIT_NUMBER",
        "value": "SHFL"
    }, {
        "name": "SHIPPER_ID",
        "value": "9024324564"
    } ],
    "shipmentId": "PBPRESORT2200171406981881",
    "parcelTrackingNumber": "0070698765432100004506511253671"
}

UPS Sample Request

curl -X GET .../v1/shipments/UPS2200170731892828?carrier=UPS \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-UnifiedErrorStructure: true"

UPS Sample Response

{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": {
        "weight": {
            "unitOfMeasurement": "OZ",
            "weight": 38
        },
        "dimension": {
            "length": 6,
            "width": 4,
            "height": 6,
            "unitOfMeasurement": "IN",
            "irregularParcelGirth": 0
        },
        "currencyCode": "USD"
    },
    "rates": [ {
        "carrier": "UPS",
        "parcelType": "PKG",
        "inductionPostalCode": "94140",
        "specialServices": [ {
            "specialServiceId": "INS",
            "fee": 0,
            "inputParameters": [ {
                "name": "INPUT_VALUE",
                "value": "100.00"
            } ]
        } ],
        "deliveryCommitment": {
            "minEstimatedNumberOfDays": "1",
            "maxEstimatedNumberOfDays": "1",
            "estimatedDeliveryDateTime": "2019-04-11 11:00:00",
            "guarantee": "FULL"
        },
        "serviceId": "NDA_AM",
        "rateTypeId": "COMMERCIAL",
        "totalCarrierCharge": 133.23,
        "totalTaxAmount": 0,
        "baseCharge": 122.24,
        "surcharges": [ {
            "name": "DELIVERY_AREA",
            "fee": 2.95
        },{
            "name": "FUEL",
            "fee": 9.39
        } ],
        "currencyCode": "USD"
    } ],
    "documents": [ {
        "size": "DOC_4X6",
        "fileFormat": "PDF",
        "contentType": "URL",
        "contents": "https://.../ups/258459135/outbound/label/2467dad3127a49048a99fa097de6535a.pdf"
    } ],
    "shipmentId": "UPS2200170731892828",
    "parcelTrackingNumber": "<tracking-number>"
}

Error Codes

For a list of all PB Shipping APIs error codes, please see Error Codes.