Note: This Request sample includes the full set of supported fields across all carriers. However, not all fields are applicable to every carrier. When making API calls from the doc portal, ensure you include only the parameters supported by the specific carrier you are integrating with. If unsupported fields are included, the request may fail.
To simplify integration and avoid errors, refer to the Postman Collection.
To explore which label types, label formats, label sizes, parcel types, services, and special services are supported by each carrier, see the Carrier Catalog. Detailed field descriptions are also provided below.
The Create Shipment API is used to create shipments and generate shipment labels. A shipment refers to the process of packing and transporting an item from a source location to a destination location using a carrier service. The API supports both domestic and international shipments.
Domestic Shipments
toAddress
and fromAddress
addresses must be within the same country.International Shipments
toAddress
must be in a different country than the fromAddress
.The V2 Create Shipment API compares shipping rates, services, and options across multiple carriers. It selects the best shipping solution based on criteria such as cost, delivery speed, or other business rules. This automates decision-making and eliminates the need for manual analysis of carrier data. It supports three RateShop types:
1. By Carrier:
2. By RuleSet
3. By RateGroup
Notes
The rateShopBy
field determines the variant to use (carrier
, ruleset
, or rategroup
).
Ensure that variant-specific fields are correctly populated:
carrierAccountId
, carrier
, and service
ruleType
and shipOption
ruleType
and rateGroupId
Define special services in one of two ways - by using a specialServiceId
or by specifying special service objects such as deliveryConfirmation
, handling
, insurance
, or returnOptions
. These two cannot be used together in the same request.
The shipment has been created successfully.
Invalid request.
The request could not be authorized.
The request could not be completed due to an internal error.
{- "fromAddress": {
- "name": "Sender Name",
- "addressLine1": "1600 Amphitheatre Parkway",
- "addressLine2": "near abc street",
- "addressLine3": "near xyz street",
- "company": "PB",
- "email": "testuser@gmail.com",
- "phone": "6502530000",
- "cityTown": "Mountain View",
- "stateProvince": "CA",
- "postalCode": 94043,
- "inductionPostalCode": "06905",
- "countryCode": "US",
- "residential": true
}, - "toAddress": {
- "name": "Recipient Name",
- "addressLine1": "350 Fifth Avenue",
- "addressLine2": "near abc street",
- "addressLine3": "near xyz street",
- "cityTown": "New York",
- "stateProvince": "NY",
- "postalCode": 10118,
- "countryCode": "US",
- "company": "PB",
- "phone": "2127363100",
- "email": "recipient@gmail.com",
- "residential": true,
- "isPOBox": true
}, - "soldToAddress": {
- "addressLine1": "1600 Amphitheatre Parkway",
- "addressLine2": "Suite 101",
- "addressLine3": "Near central market",
- "company": "ABC Company",
- "name": "John Doe",
- "phone": "650-253-0000",
- "email": "billing@abccompany.com",
- "residential": false,
- "cityTown": "Mountain View",
- "stateProvince": "CA",
- "postalCode": "94043",
- "countryCode": "US",
- "taxId": "string",
- "taxIdType": "EIN"
}, - "additionalAddresses": [
- {
- "address": {
- "residential": false,
- "phone": "732-443-1007",
- "countryCode": "US",
- "company": "ABC Company",
- "postalCode": "08810-1411",
- "cityTown": "DAYTON",
- "name": "Warehouse Manager",
- "stateProvince": "NJ",
- "addressLine1": "2270 US HIGHWAY 130"
}, - "addressType": "BROKER"
}
], - "altReturnAddress": {
- "addressLine1": "500 Terry Francois Blvd",
- "addressLine2": "near abc street",
- "addressLine3": "near xyz street",
- "company": "PB",
- "email": "user@email.com",
- "residential": true,
- "cityTown": "San Francisco",
- "countryCode": "US",
- "name": "User Name",
- "phone": "415-555-7890",
- "postalCode": "94158",
- "stateProvince": "CA"
}, - "parcel": {
- "length": 2,
- "width": 1,
- "height": 1,
- "dimUnit": "IN",
- "weightUnit": "OZ",
- "weight": 2,
- "packageValue": 2
}, - "parcelType": "PKG",
- "rateShopBy": "carrier",
- "byCarrier": {
- "carrierAccountId": "zmOKKBAn0X1",
- "carrier": "FedEx",
- "service": "NDA"
}, - "shipmentOptions": {
- "addToManifest": true,
- "minimalAddressValidation": true,
- "bookingConfirmationNumber": "1085test",
- "b2b": true,
- "senderEORI": "GB123456789101",
- "recipientEORI": "GB123456789102",
- "senderUKIMSNumber": "GBUKIM12345678910100000000000000",
- "exportLicenceRequired": true,
- "shipperID": "1234567890"
}, - "carrierPayments": [
- {
- "accountNumber": "602684342",
- "countryCode": "US",
- "postalCode": "30305",
- "party": "BILL_RECEIVER",
- "typeOfCharge": "ALL_CHARGES"
}
], - "docTab": {
- "templateName": "1",
- "toAddressName": {
- "displayName": "CUS",
- "value": "",
- "row": 1,
- "column": 1
}, - "parcelTrackingNumber": {
- "displayName": "TRK",
- "value": "",
- "row": 2,
- "column": 1
}, - "carrier": {
- "displayName": "CAR",
- "value": "",
- "row": 3,
- "column": 1
}, - "serviceId": {
- "displayName": "SER",
- "value": "",
- "row": 1,
- "column": 2
}, - "dateOfShipment": {
- "displayName": "DATE",
- "value": "",
- "row": 2,
- "column": 2
}, - "pieceNumber": {
- "displayName": "PKG#",
- "value": "",
- "row": 3,
- "column": 2
}, - "packageTotalCarrierCharge": {
- "displayName": "PCHG",
- "value": "",
- "row": 3,
- "column": 3
}, - "totalCarrierCharge": {
- "displayName": "TCHG",
- "value": "",
- "row": 2,
- "column": 3
}, - "packageWeight": {
- "displayName": "PWGT",
- "value": "",
- "row": 1,
- "column": 3
}, - "totalWeight": {
- "displayName": "TWGT",
- "value": "",
- "row": 1,
- "column": 4
}, - "customField1": {
- "displayName": "INV",
- "value": "010610000388302031320259999950",
- "row": 2,
- "column": 4
}
}, - "specialServices": [
- {
- "inputParameters": [
- {
- "name": "INPUT_VALUE",
- "value": "100"
}
], - "specialserviceId": "Ins"
}
], - "deliveryConfirmation": {
- "type": "ADULT_SIGNATURE"
}, - "handling": {
- "type": "ADDITIONAL_HANDLING"
}, - "insurance": {
- "type": "INSURANCE",
- "amount": 200
}, - "references": {
- "reference1": "custome message",
- "reference2": "SendTech",
- "reference3": "98437",
- "reference4": "Overnight Shipping",
- "poNumber": "R2W 2H2",
- "department": "Name department",
- "additionalReference1": "612987641",
- "additionalReference2": "989"
}, - "metadata": [
- {
- "name": "costAccountName",
- "value": "cost1"
}
], - "labelSize": "DOC_4X6",
- "labelType": "SHIPPING_LABEL",
- "labelFormat": "ZPL2",
- "contentType": "BASE64",
- "printerAliasName": "test",
- "dateOfShipment": "2024-03-20",
- "deliveryOption": {
- "deliverBy": "2024-03-20",
- "useBestNextDate": false
}, - "returnOptions": {
- "type": "RETURN_BY_PRL",
- "inputParameters": [
- {
- "name": "RMA_NUMBER",
- "value": "123"
}
]
}, - "customs": {
- "customsInfo": {
- "reasonForExport": "DOCUMENTS",
- "comments": "Test comment",
- "invoiceNumber": "001189223",
- "importerCustomsReference": "987654",
- "sdrValue": 23.32,
- "EELPFC": "NOEEI 30.2D2",
- "currencyCode": "USD",
- "fromCustomsReference": "EFEFE4554545",
- "licenseNumber": "456ABC123",
- "certificateNumber": "987",
- "customsDeclaredValue": 6000,
- "termsOfSale": "DDU"
}, - "customsItems": [
- {
- "description": "Books",
- "quantity": 1,
- "unitPrice": 3000,
- "weightUnit": "OZ",
- "weight": 0.1,
- "hSTariffCode": "AST559",
- "originCountryCode": "US"
}
], - "customsDocuments": [
- {
- "fileName": "invoice.pdf",
- "s3FileId": "uploads/shipping/intl_docs/sa58a03/0oa2bxnhu03i48mh50h8/NJ3ww7gv73kwDJK/DRNgGjEraOvV8ZB_invoice.pdf",
- "documentType": "INVOICE"
}
]
}
}
{- "correlationId": "3e2a71cc421e40b7970db9d540b1c7f2",
- "shipmentId": "FEDEX2200626443337314",
- "parcelTrackingNumber": 329039098457,
- "labelLayout": [
- {
- "contentType": "BASE64",
- "contents": "XlhBCl5MSDE2LDEyCl5MTDEyMTIKXkZUIDU4MSwgNDAzIF5BVU4gIF5GRDAwMDNeRlMgXkZYIENvbmZpZ3VyYWJsZSBUZXh0IDEK...",
- "fileFormat": "ZPL2",
- "size": "DOC_4X6",
- "type": "SHIPPING_LABEL"
}
], - "parcel": {
- "length": 2,
- "width": 1,
- "height": 1,
- "dimUnit": "IN",
- "weightUnit": "OZ",
- "weight": 2,
- "packageValue": 2
}, - "rate": {
- "baseCharge": 16.15,
- "carrier": "PUROLATOR",
- "currencyCode": "CAD",
- "parcelType": "PKG",
- "serviceId": "GRD",
- "surcharges": [
- {
- "fee": 2.95,
- "name": "ResidentialDelivery"
}
], - "totalCarrierCharge": 22.46,
- "deliveryCommitment": {
- "estimatedDeliveryDateTime": "2024-03-25",
- "maxEstimatedNumberOfDays": 5,
- "guarantee": "None"
}, - "inductionPostalCode": "06905",
- "destinationZone": 1,
- "baseChargeTaxes": [
- {
- "displayName": "Canada goods and services",
- "name": "GST",
- "taxAmount": 2.69
}
], - "totalTaxAmount": 2.69,
- "publishedTotalCarrierCharge": 73.12
}, - "references": {
- "reference1": "custome message",
- "reference2": "SendTech",
- "reference3": "98437",
- "reference4": "Overnight Shipping",
- "poNumber": "R2W 2H2",
- "department": "Name department",
- "additionalReference1": "612987641",
- "additionalReference2": "989"
}, - "printStatus": "submitted",
- "printError": {
- "code": "validation_error",
- "message": "Api is not supported for your 1.10.15 version please install latest dh version"
}, - "fromAddress": {
- "name": "Sender Name",
- "addressLine1": "1600 Amphitheatre Parkway",
- "addressLine2": "near abc street",
- "addressLine3": "near xyz street",
- "company": "PB",
- "email": "testuser@gmail.com",
- "phone": "6502530000",
- "cityTown": "Mountain View",
- "stateProvince": "CA",
- "postalCode": "94043",
- "inductionPostalCode": "06905",
- "countryCode": "US",
- "residential": true
}, - "toAddress": {
- "name": "Recipient Name",
- "addressLine1": "350 Fifth Avenue",
- "addressLine2": "near abc street",
- "addressLine3": "near xyz street",
- "cityTown": "New York",
- "stateProvince": "NY",
- "postalCode": "10118",
- "countryCode": "US",
- "company": "PB",
- "phone": "332 555-1212",
- "email": "recipient@gmail.com",
- "residential": true,
- "isPOBox": true
}, - "soldToAddress": {
- "addressLine1": "70 Hanlan RD",
- "addressLine2": "Suite 101",
- "addressLine3": "Near central market",
- "company": "ABC Company",
- "name": "John Doe",
- "phone": "905-555-1234",
- "email": "billing@abccompany.com",
- "residential": false,
- "cityTown": "Woodbridge",
- "stateProvince": "ON",
- "postalCode": "L4L 3P6",
- "countryCode": "CA"
}, - "additionalAddresses": [
- {
- "address": {
- "residential": false,
- "phone": "732-443-1007",
- "countryCode": "US",
- "company": "ABC Company",
- "postalCode": "08810-1411",
- "cityTown": "DAYTON",
- "name": "Warehouse Manager",
- "stateProvince": "NJ",
- "addressLine1": "2270 US HIGHWAY 130"
}, - "addressType": "BROKER"
}
], - "shipmentOptions": {
- "addToManifest": true,
- "printCustomMessage": "Print Message 1",
- "receiptOption": "RECEIPT_WITH_INSTRUCTIONS",
- "printDepartment": "department",
- "printInvoiceNumber": "invoicenumber",
- "printPONumber": "ponumber",
- "shipperId": "1234567890",
- "minimalAddressValidation": true,
- "billingWeight": "128.0",
- "bookingConfirmationNumber": "XXXX56789812"
}, - "carrierPayments": [
- {
- "accountNumber": "602684342",
- "countryCode": "US",
- "postalCode": "30305",
- "party": "BILL_RECEIVER",
- "typeOfCharge": "ALL_CHARGES"
}
]
}