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.

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 an error or returned no response at all. If that was the case, do one of the following instead:
    • If the initial request returned the HTTP 500 error or returned no response at all, use the Retry Shipment API to check whether the label exists and return it if it does. If the Retry Shipment API returns an error, you must create a new label with a new Transaction ID.
    • If the initial request returned an error other than the HTTP 500 error, you cannot reprint the label but must instead create a new label 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.

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 Parameters

Name Data Type Description
shipmentId String Required. The shipment ID that was issued when shipment label was generated.

Query Parameter

Name Data Type Description
carrier String

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

The values are not case-sensitive.

Request Header

Name Data Type Description
Authorization String Required. OAuth token generated using the Generate an OAuth Token API.

Response Elements

IMPORTANT: Some fields might not apply to your operation.

The response returns a shipment object. The following table describes all the possible fields in a shipment object.

Name Data Type Description
fromAddress address object

Required. Origin address.

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

toAddress address object Required. Destination address.
altReturnAddress address object International Shipments Only. If you are sending an international shipment and if you have set the NON_DELIVERY_OPTION shipment option to redirect, then enter the address that a returned parcel should go to.
parcel parcel object Required. Contains physical characteristics of the parcel.
rates Array[rates object]

Required. Specifies carrier, service, parcel type, and other information. In a response, this field specifies the service charges.

Important: In a request, the rates array can contain only one rates object.

documents Array[documents object] A list of shipment documents pertaining to a shipment, including the label. This field does not apply to Rate a Package requests.
shipmentOptions Array[Object]

Each object in this array defines a shipment option. The available options depend on the carrier, origin country, and destination country.

Required if you are creating a shipment. For shipments the array must contain the SHIPPER_ID option. Other requirements might also apply, depending on the type of shipment.

        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 customs object

Applies only to these shipments:

  • International
  • APO/FPO/DPO
  • Territories/Possessions
  • FAS

This field contains customs information.

shipmentType String SBR Labels Only. If you are creating a Scan-Based Return (SBR) label, include this field and set the value to RETURN.
references Array[Object]

Newgistics Only. 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.

Examples

This section contains examples for the following carriers:

USPS

Sample Request — USPS

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

Sample Response — USPS

{
    "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": "4671165683"
    }, {
        "name": "ADD_TO_MANIFEST",
        "value": "true"
    }, {
        "name": "FUTURE_SHIPMENT_DATE",
        "value": "2018-06-08"
    }, {
        "name": "MINIMAL_ADDRESS_VALIDATION",
        "value": "true"
    } ],
    "shipmentId": "USPS2200171406955211",
    "parcelTrackingNumber": "9405509898641490995613"
}

Newgistics

Sample Request — Newgistics

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

Sample Response — Newgistics

{
    "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": "9024998978"
    }, {
        "name": "CLIENT_FACILITY_ID",
        "value": "0093"
    }, {
        "name": "CARRIER_FACILITY_ID",
        "value": "1585"
    } ],
    "shipmentId": "NEWGISTICS2200171328057769",
    "parcelTrackingNumber": "4206740192612123456789000000225206"
}

PB Presort

Sample Request — PB Presort

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

Sample Response — PB Presort

{
    "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": "MINIMAL_ADDRESS_VALIDATION",
        "value": "true"
    }, {
        "name": "PERMIT_NUMBER",
        "value": "SHFL"
    }, {
        "name": "SHIPPER_ID",
        "value": "9024998978"
    } ],
    "shipmentId": "PBPRESORT2200171406981881",
    "parcelTrackingNumber": "0070698765432100004506511253671"
}

Error Codes

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