Create a PB Cross-Border Delivery Service Shipment

HTTP Request

POST /v1/shipments?carrier=PBI

Summary

PB Cross-Border Delivery Service (CBDS) provides shipping from U.S. consolidation centers to international destinations and performs checks to ensure parcels comply with international regulations prior to shipment.

Invoking this API creates a CBDS shipment and submits parcel data for the compliance checks. Depending on the merchant’s setup, the API also prints the first-mile label for delivery to the consolidation center. The API either prints the first-mile label (First-Mile Inclusive) or requires the merchant to print the first-mile label separately, prior to invoking this API (First-Mile Exclusive). If separately, the merchant passes the label’s tracking number when issuing this API call.

Prerequisites

  • To use this API, your Developer Account must be enabled for CBDS. Please see Onboard with CBDS.
  • To improve the accuracy of restriction screening, it is recommended that you provide Pitney Bowes with a category tree. See Category Tree.

Testing in Sandbox

CBDS provides mock Client IDs for use when testing in Sandbox. See Client ID.

Things to Consider

  1. 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.

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

    Service ID
    Service Name
    Description
    PBXPS Standard DDP This service is cost effective and offers full tracking.
    PBXUS Standard DDU The service uses postal clearance at the country of destination.
    PBXPE Expedited DDP This service is faster than Prepay Standard and costs more. It offers full tracking. Note: Expedited DDP does not support delivery to P.O. Boxes.
  3. 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"
        }
    }
    
  4. 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"
    
  5. If the merchant is set up for First-Mile Inclusive, the API response returns:

    • The first-mile label. The label must be used within 25 days.
    • The estimated charges, which include the transportation cost and, if applicable, the importation costs.
    • A tracking number that tracks the parcel for the full journey, from the U.S. origin address to the international destination.
  6. If the merchant is set up for First-Mile Exclusive, then prior to invoking this API, use Pitney Bowes or another domestic carrier to print a first-mile label for delivery of the parcel to the consolidation center. Enter the label’s tracking number when invoking this API.

    The API response returns:

    • The estimated charges, which include the transportation cost and, if applicable, the importation costs.
    • A tracking number that tracks the parcel for the full journey, from the U.S. origin address to the international destination.

    The API does not return a first-mile label.

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: Ensure this is unique.

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.

FedEx, UPS: If you are shipping with FedEx or 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.
  • CBDS: 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 shipping document created by the API call. This field is required for Create Shipment requests, except for requests that use the CBDS First-Mile Exclusive solution. This field does not apply to First-Mile Exclusive shipments and 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 the following carriers in the following situations:

  • USPS, for shipments to international destinations and to APO/FPO/DPO, Territories/Possessions, and FAS
  • CBDS, for all shipments
  • FedEx, for shipments to international destinations and Puerto Rico
  • UPS, for 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 CBDS Only. Required if the merchant uses the CBDS First-Mile Exclusive solution. Contains information about the domestic leg of the shipment. This field does not apply to the First-Mile Inclusive solution.
soldToAddress Address Object

Applies only to FedEx and UPS. This contains 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 an Expedited Return label or Scan-Based Return label, include this field and set the value to RETURN.
references Array[Object]

Enters shipper-generated values. Applies only to the following:

  • Newgistics: Optional. This array maps shipper-generated values to fields in the Newgistics package record. Use this array to pass Order Numbers and other custom values for use in Newgistics manifesting and billing. The values do not appear on the shipping label.

    The array takes up to three objects. Each maps to a specific Newgistics field. The object’s position in the array determines which field. The first object maps to the Newgistics “ReferenceNumber” field; the second to the “AddlRef1” field; and the third to the “AddlRef2” field. For each object you include, enter the name values as shown below. If you enter different values, the system will change them to those below. In the value fields, enter the shipper-generated values as string values of up to 50 characters each.

    {
        "name": "ReferenceNumber",
        "value": "<shipper-generated value>"
    }, {
        "name": "AddlRef1",
        "value": "<shipper-generated value>"
    }, {
        "name": "AddlRef2",
        "value": "<shipper-generated value>"
    }
    
  • CBDS: Contains the the shipper-generated order ID. This is array is optional but is recommended. When you include the order ID in this array, the ID is included in the Pitney Bowes tracking files and invoice, allowing you tie the shipment to your system through the ID. This array takes the following object, where <order_ID> is the shipper-generated order ID:

    {
        "name": "ORDER_NUMBER",
        "value": "<order_ID>"
    }
    
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:

First-Mile Inclusive Sample Request

The following is a sample request for creating a Cross-Border shipment that prints the first-mile label (First-Mile Inclusive). The response returns a label:

First-Mile Inclusive Sample Request
curl -X POST .../v1/shipments?carrier=PBI&includeDeliveryCommitment=true \
-H "Authorization: Bearer <oauth_token>" \
-H "Content-Type: application/json" \
-H "X-PB-TransactionId: <unique_transaction_id>" \
-d '
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "altReturnAddress": { ... },
    "parcel": {
        "weight": {
            "unitOfMeasurement": "lb",
            "weight": "0.005"
        },
        "dimension": {
            "unitOfMeasurement": "in",
            "length": "5",
            "width": "2",
            "height": "3"
        },
        "currencyCode": "USD"
    },
    "customs": {
        "customsInfo": {
            "currencyCode": "USD"
        },
        "customsItems": [ {
            "itemId": "SKU123",
            "identifiers": [ {
                "number": "123",
                "source": "none"
            } ],
            "description": "test123",
            "quantity": 2,
            "unitPrice": 400.88,
            "url": "example.com",
            "unitWeight": {
                "weight": 0.005,
                "unitOfMeasurement": "lb"
            },
            "originCountryCode": "GB",
            "categories": [ {
                "categoryCode": "10203",
                "categoryNamePath": "CONSUMABLES AND GROCERY|BABY|BABY CARE|BABY CONSUMABLES|BABY FOOD",
                "categoryCodePath": "9785:8266:9798:9799:10203"
            } ],
            "itemDimension": {
                "length": 10,
                "height": 7,
                "width": 8,
                "unitOfMeasurement": "cm"
            },
            "brand": "brand1",
            "hSTariffCode": "610120",
            "hSTariffCodeCountry": "US"
        } ]
    },
    "rates": [ {
        "carrier": "PBI",
        "serviceId": "PBXPS",
        "parcelType": "PKG",
        "specialServices": [ {
            "specialServiceId": "Ins",
            "inputParameters": [ {
                "name": "INPUT_VALUE",
                "value": "50"
            } ]
        }, {
            "specialServiceId": "ADSIG",
            "inputParameters": [ {
                "name": "INPUT_VALUE",
                "value": "0"
            } ]
        } ]
    } ],
    "documents": [ {
        "type": "SHIPPING_LABEL",
        "contentType": "URL",
        "size": "DOC_8X11",
        "fileFormat": "PDF",
        "printDialogOption": "EMBED_PRINT_DIALOG"
    } ],
    "references": [ {
        "name": "ORDER_NUMBER",
        "value": "123456"
    } ],
    "shipmentOptions": [ {
        "name": "SHIPPER_ID",
        "value": "9024324564"
    },{
        "name": "CLIENT_ID",
        "value": "UP3456"
    } ]
}
First-Mile Inclusive Sample Response
{
    "fromAddress": { ... },
    "toAddress": { ... },
    "parcel": {
        "dimension": {
            "length": 5,
            "height": 3,
            "width": 2,
            "unitOfMeasurement": "in",
            "irregularParcelGirth": "0.0"
        },
        "weight": {
            "weight": 0.005,
            "unitOfMeasurement": "Lb"
        },
        "valueOfGoods": 801.76
    },
    "rates": [ {
        "carrier": "PBI",
        "serviceId": "PBXPS",
        "parcelType": "PKG",
        "specialServices": [ {
            "specialServiceId": "Ins",
            "inputParameters": [ {
                "name": "INPUT_VALUE",
                "value": "50"
            } ],
            "fee": 2.2
        }, {
            "specialServiceId": "ADSIG",
            "inputParameters": [ {
                "name": "INPUT_VALUE",
                "value": "0"
            } ],
            "fee": 6.4
        } ],
        "inductionPostalCode": "06810",
        "dimensionalWeight": {
            "weight": 0,
            "unitOfMeasurement": "OZ"
        },
        "baseCharge": 6.55,
        "totalCarrierCharge": 282.47,
        "deliveryCommitment": {
            "minEstimatedNumberOfDays": "6",
            "maxEstimatedNumberOfDays": "9",
            "estimatedDeliveryDateTime": "2020-02-05",
            "guarantee": "NONE",
            "additionalDetails": "By end of Day"
        },
        "currencyCode": "USD",
        "destinationZone": 4,
        "totalDutyAmount": 144.32,
        "totalTaxAmount": 123
    } ],
    "documents": [ {
        "type": "SHIPPING_LABEL",
        "size": "DOC_8X11",
        "fileFormat": "PDF",
        "contentType": "URL",
        "contents": "https://.../usps/325584758/outbound/label/9d1da50f82734ab9d4a41d5ffb9a19b.pdf"
    } ],
    "shipmentOptions": [ {
        "name": "SHIPPER_ID",
        "value": "9024324564"
    },{
        "name": "CLIENT_ID",
        "value": "UP3456"
    } ],
    "customs": {
        "customsInfo": {
            "currencyCode": "USD"
        },
        "customsItems": [ {
            "itemId": "SKU123",
            "identifiers": [ {
                "number": "123",
                "source": "none"
            } ],
            "description": "test123",
            "quantity": 2,
            "unitPrice": 400.88,
            "url": "example.com",
            "unitWeight": {
                "weight": 0.005,
                "unitOfMeasurement": "lb"
            },
            "originCountryCode": "GB",
            "categories": [ {
                "categoryCode": "10203",
                "categoryNamePath": "CONSUMABLES AND GROCERY|BABY|BABY CARE|BABY CONSUMABLES|BABY FOOD",
                "categoryCodePath": "9785:8266:9798:9799:10203"
            } ],
            "itemDimension": {
                "length": 10,
                "height": 7,
                "width": 8,
                "unitOfMeasurement": "cm"
            },
            "brand": "brand1",
            "hSTariffCode": "610120",
            "hSTariffCodeCountry": "US"
        } ]
    },
    "parcelTrackingNumber": "UPGUS0164FC110CCA57",
    "shipmentId": "UPGUS00164FC10CCA57"
}

First-Mile Exclusive Sample Request

The following is a sample request for creating a Cross-Border shipment that returns a tracking number but no label (First-Mile Exclusive). The merchant prints the first-mile label prior to invoking the API and passes in the tracking number.

First-Mile Exclusive Sample Request
curl -X POST .../v1/shipments?carrier=PBI&includeDeliveryCommitment=true \
-H "Authorization: Bearer <oauth_token>" \
-H "Content-Type: application/json" \
-H "X-PB-TransactionId: <unique_transaction_id>" \
-d '
{
    "fromAddress": {
        "addressLines": [
            "2352 Bent Creek Rd"
        ],
        "cityTown": "Auburn",
        "stateProvince": "AL",
        "postalCode": "36830",
        "countryCode": "US",
        "company": "Shop",
        "name": "Kathryn Smith",
        "phone": "334-000-0000",
        "email": "kathryn@example.com",
        "residential": false
    },
    "toAddress": {
        "addressLines": [
            "3 1st Ave NW"
        ],
        "cityTown": "Mayo",
        "stateProvince": "YT",
        "postalCode": "1M0",
        "countryCode": "AU",
        "name": "Julia Brown",
        "phone": "1234567890",
        "email": "julia@example.net",
        "residential": true
    },
    "altReturnAddress ": {
        "addressLines": [
            "2800 Bent Creek Rd"
        ],
        "cityTown": "Auburn",
        "stateProvince": "AL",
        "postalCode": "36830",
        "countryCode": "US",
        "name": "Manager",
        "company": "Returns",
        "email": "returns@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": "CLIENT_ID",
        "value": "C12345"
    },{
        "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": "00065",
                "parentCategoryCode": "00857",
                "descriptions": [ {
                    "locale": "en_US",
                    "name": "Shirts",
                    "parentsName": [ "Clothing", "Men" ]
                } ],
                "categoryNamePath": "Clothing|Men|Shirts",
                "categoryCodePath": "01724:00857:00065"
            } ],
            "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"
    } ]
}'
First-Mile Exclusive Sample Response
{
    "fromAddress": {
        "addressLines": [
            "2352 Bent Creek Rd"
        ],
        "cityTown": "Auburn",
        "stateProvince": "AL",
        "postalCode": "36830",
        "countryCode": "US",
        "company": "Shop",
        "name": "Kathryn Smith",
        "phone": "334-000-0000",
        "email": "kathryn@example.com",
        "residential": false
    },
    "toAddress": {
        "addressLines": [
            "3 1st Ave NW"
        ],
        "cityTown": "Mayo",
        "stateProvince": "YT",
        "postalCode": "1M0",
        "countryCode": "AU",
        "name": "Julia Brown",
        "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": 55.57,
        "deliveryCommitment": {
            "minEstimatedNumberOfDays": "6",
            "maxEstimatedNumberOfDays": "9"
        },
        "currencyCode": "USD",
        "totalTaxAmount": 16.13
    } ],
    "shipmentOptions": [ {
        "name": "SHIPPER_ID",
        "value": "9024324564"
    },{
        "name": "CLIENT_ID",
        "value": "C12345"
    },{
        "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": "00065",
                "parentCategoryCode": "00857",
                "descriptions": [ {
                    "locale": "en_US",
                    "name": "Shirts"
                } ],
                "categoryNamePath": "Clothing|Men|Shirts",
                "categoryCodePath": "01724:00857:00065"
            } ],
            "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 130####.

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