Create a PB Cross-Border Shipment

HTTP Request

POST /v1/shipments?carrier=PBI

Summary

PB Cross-Border provides shipping from U.S. Cross-Border consolidation centers to international destinations and performs checks to ensure parcels comply with international regulations prior to shipment. Before you issue this API call, you must create a first-mile label to ship the parcel to a Cross-Border consolidation center. You pass the first-mile label’s tracking number when issuing this API.

Invoking this API creates the shipment and sets up the compliance checks but does not print the international label. Instead, Cross-Border prints the international label when the parcel arrives at the consolidation center. The API’s response returns the shipment’s estimated charges and returns a Cross-Border tracking number that tracks the parcel for the full journey, from the U.S. origin address to the international destination.

The estimated charges include the transportation cost and, if applicable, the importation costs. Importation costs include duties and taxes and any disbursement fee. The shipment’s service class determines whether the merchant or the buyer pays the importation costs. Estimated importation costs are returned only if the merchant pays.

Prerequisites

  • To use this operation, your Developer Account must be enabled for PB Cross-Border. Please see Onboard with PB Cross-Border.
  • To improve the accuracy of restriction screening, it is recommended that you provide Cross-Border with a category tree. See Category Tree.

Sequence to Ship with Cross-Border

To ship with Cross-Border:

  1. Print a first-mile label for delivery of the parcel to a Cross-Border consolidation center. For the first-mile carrier, you may use Pitney Bowes or any domestic carrier.

  2. Record the first-mile label’s tracking number.

  3. Issue this API call and include the tracking number of the first-mile label.

    The API returns the estimated charges and a new tracking number. The new tracking number tracks the parcel for the full journey, from the U.S. origin address to the consolidation center to the international destination. Note that the API does not return the international label.

Things to Consider

  1. The cost of the shipment is the cost from the PB Cross-Border consolidation center, which is listed in the toAddress, to the final destination.

  2. The following fields are required in the request’s Address Objects:

    • addressLines
    • cityTown
    • postalCode
    • countryCode
    • name

    For Canadian addresses, the stateProvince field is also required. Use the 2-letter province code.

  3. Cross-Border supports the following service classes, but the available service classes depend on the delivery agreement:

    Service ID
    Service Class
    Terms of Delivery
    Description
    PBXPS Prepay Standard Delivered Duty Paid This service is cost effective and offers full tracking.
    PBXUS Postpay Standard Delivered Duty Unpaid The service uses postal clearance at the country of destination.

    Sandbox Only:

    PBXPE
    Prepay Express
    Delivered Duty Paid
    This service is faster than Prepay Standard and costs more. It offers full tracking.
  4. In the customInfo object, use only the currencyCode field and set the value to USD, as shown here. The field is required.

    "customs": {
        "customsInfo": {
            "currencyCode": "USD"
        }
    }
    
  5. To facilitate assignment of the correct HS Code, provide the brand and item details in the customItems.description field.

    The following are example descriptions:

    "description": "Acme AC8431 Rechargeable Hand Blender with Electric Knife Attachment"
    
    "description": "Antique Vintage Victorian Edwardian Walnut Writing Stationery Box"
    
    "description": "Pitney Bowes 793-5 Fluorescent Red Ink Cartridge DM100 DM200"
    

Request URIs

Sandbox: https://api-sandbox.pitneybowes.com/shippingservices/v1/shipments?carrier=PBI
Production: https://api.pitneybowes.com/shippingservices/v1/shipments?carrier=PBI

Query Parameter

Name Description
includeDeliveryCommitment If set to true, returns estimated transit times in days.
carrier Required. Set this to PBI.

Request Headers

Name Description
Authorization Required. OAuth token generated using the Generate an OAuth Token API.
Content-Type Required. The media type of the request entity. Set this to application/json.
X-PB-TransactionId

Required. A unique identifier for the transaction, up to 25 characters.

Important: You must ensure this is a unique id.

X-PB-UnifiedErrorStructure Recommended. Set this to true to use the standard error object if an error occurs.

Request / Response Elements

The API call sends and receives a Shipment Object. The table below describes all possible fields in a Shipment Object.

Important

Some fields in the Shipment Object do not apply to this 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. The altReturnAddress is not returned in the response.
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 Request

curl -X POST .../v1/shipments?carrier=PBI&includeDeliveryCommitment=true \
-H "Authorization: Bearer olVCndjE5lFnQkXaNKHYwQajz8qB" \
-H "Content-Type: application/json" \
-H "X-PB-TransactionId: 2f1d2c42aa5c1fe4-2945bb" \
-d '
{
    "fromAddress": {
        "addressLines": [
            "2358 Bent Creek Rd"
        ],
        "cityTown": "Auburn",
        "stateProvince": "AL",
        "postalCode": "36830",
        "countryCode": "US",
        "company": "Shop",
        "name": "Kathryn Smith",
        "phone": "3340000000",
        "email": "kathryn@example.com",
        "residential": false
    },
    "toAddress": {
        "addressLines": [
            "3 1st Ave NW"
        ],
        "cityTown": "Mayo",
        "stateProvince": "YT",
        "postalCode": "1M0",
        "countryCode": "AU",
        "name": "Julia Jones",
        "phone": "1234567890",
        "email": "julia@example.net",
        "residential": true
    },
    "altReturnAddress ": {
        "addressLines": [
            "2358 Bent Creek Rd"
        ],
        "cityTown": "Auburn",
        "stateProvince": "AL",
        "postalCode": "36830",
        "countryCode": "US",
        "name": "Manager",
        "company": "Returns",
        "phone": "3340000000",
        "email": "manager@example.com",
        "residential": false
    },
    "parcel": {
        "weight": {
            "unitOfMeasurement": "OZ",
            "weight": 24
        },
        "dimension": {
            "unitOfMeasurement": "IN",
            "length": "16",
            "width": "12",
            "height": "2"
        }
    },
    "rates": [ {
        "carrier": "PBI",
        "serviceId": "PBXPS",
        "parcelType": "PKG"
    } ],
    "shipmentOptions": [ {
        "name": "SHIPPER_ID",
        "value": "9024324564"
    },{
        "name": "CARRIER_FACILITY_ID",
        "value": "US_ELOVATIONS_KY"
    },{
        "name": "CLIENT_FACILITY_ID",
        "value": "CVG"
    } ],
    "customs": {
        "customsInfo": {
            "currencyCode": "USD"
        },
        "customsItems": [ {
            "itemId": "43953AE0",
            "identifiers": [ {
                "number": "841843",
                "source": "MPN"
            } ],
            "description": "clothing men's shirt casual button-down slim fit cotton wrinkle-free single-needle construction",
            "quantity": 1,
            "unitPrice": 45.00,
            "url": "http://www.example.com/shop/43953AE0",
            "unitWeight": {
                "weight": 12,
                "unitOfMeasurement": "OZ"
            },
            "originCountryCode": "US",
            "condition": "new",
            "manufacturer": "Acme Inc.",
            "categories": [ {
                "categoryCode": "4356",
                "parentCategoryCode": "6500",
                "descriptions": [ {
                    "locale": "en_US",
                    "name": "Shirts",
                    "parentsName": [ "Clothing", "Men" ]
                } ],
                "categoryNamePath": "Clothing|Men|Shirts",
                "categoryCodePath": "3400:6500:4356"
            } ],
            "itemDimension": {
                "length": 14.0,
                "height": 11.0,
                "width": 1.0,
                "unitOfMeasurement": "IN"
            },
            "brand": "Acme Brand",
            "imageURL": [
                "http://www.example.com/shop/43953AE0/image01.png",
                "http://www.example.com/shop/43953AE0/image02.png"
            ],
            "pricing": {
                "price": 45.00
            },
            "hSTariffCode": "6205200010",
            "hSTariffCodeCountry": "CA"
        },
        { ... },
        ...
        ]
    },
    "domesticShipmentDetails": {
        "shipperTrackingNumber": "USPS13600150468397",
        "carrier": "USPS"
    },
    "references": [ {
        "name": "ORDER_NUMBER",
        "value": "123780"
    } ]
}'

Sample Response

{
    "fromAddress": {
        "addressLines": [
            "2358 Bent Creek Rd"
        ],
        "cityTown": "Auburn",
        "stateProvince": "AL",
        "postalCode": "36830",
        "countryCode": "US",
        "company": "Shop",
        "name": "Kathryn Smith",
        "phone": "3340000000",
        "email": "kathryn@example.com",
        "residential": false
    },
    "toAddress": {
        "addressLines": [
            "3 1st Ave NW"
        ],
        "cityTown": "Mayo",
        "stateProvince": "YT",
        "postalCode": "1M0",
        "countryCode": "AU",
        "name": "Julia Jones",
        "phone": "1234567890",
        "email": "julia@example.net",
        "residential": true
    },
    "parcel": {
        "dimension": {
            "length": 16,
            "height": 2,
            "width": 12,
            "unitOfMeasurement": "IN"
        },
        "weight": {
            "weight": 24,
            "unitOfMeasurement": "OZ"
        },
        "valueOfGoods": 125.00
    },
    "rates": [ {
        "carrier": "PBI",
        "serviceId": "PBXPS",
        "parcelType": "PKG",
        "baseCharge": 39.44,
        "totalCarrierCharge": 49.25,
        "deliveryCommitment": {
            "minEstimatedNumberOfDays": "6",
            "maxEstimatedNumberOfDays": "9"
        },
        "currencyCode": "USD",
        "totalTaxAmount": 16.13
    } ],
    "shipmentOptions": [ {
        "name": "SHIPPER_ID",
        "value": "9024324564"
    },{
        "name": "CARRIER_FACILITY_ID",
        "value": "US_ELOVATIONS_KY"
    },{
        "name": "CLIENT_FACILITY_ID",
        "value": "CVG"
    } ],
    "customs": {
        "customsInfo": {
            "currencyCode": "USD"
        },
        "customsItems": [ {
            "itemId": "43953AE0",
            "identifiers": [ {
                "number": "841843",
                "source": "MPN"
            } ],
            "description": "clothing men's shirt casual button-down slim fit cotton wrinkle-free single-needle construction",
            "quantity": 1,
            "unitPrice": 45.00,
            "url": "http://www.example.com/shop/43953AE0",
            "unitWeight": {
                "weight": 12,
                "unitOfMeasurement": "OZ"
            },
            "originCountryCode": "US",
            "condition": "new",
            "manufacturer": "Acme Inc.",
            "categories": [ {
                "categoryCode": "4356",
                "parentCategoryCode": "6500",
                "descriptions": [ {
                    "locale": "en_US",
                    "name": "Shirts"
                } ],
                "categoryNamePath": "Clothing|Men|Shirts",
                "categoryCodePath": "3400:6500:4356"
            } ],
            "itemDimension": {
                "length": 14.0,
                "height": 11.0,
                "width": 1.0,
                "unitOfMeasurement": "IN"
            },
            "brand": "Acme Brand",
            "imageURL": [
                "http://www.example.com/shop/43953AE0/image01.png",
                "http://www.example.com/shop/43953AE0/image02.png"
            ],
            "pricing": {
                "price": 45.00
            },
            "hSTariffCode": "6205200010",
            "hSTariffCodeCountry": "CA"
        },
        { ... },
        ...
        ]
    },
    "domesticShipmentDetails": {
        "carrier": "USPS",
        "shipperTrackingNumber": "USPS13600150468397"
    },
    "references": [ {
        "name": "ORDER_NUMBER",
        "value": "123780"
    } ],
    "parcelTrackingNumber": "UPGUS001580DCC1281C0",
    "shipmentId": "UPGUS001580DCC1281C0"
}

Error Codes

For common error codes specific to this API call, please see 13#####.

For all error codes for the PB Shipping APIs, please see Error Codes.