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 four RateShop types:
1. By Carrier:
2. By RuleSet
3. By RateGroup
4. By CustomCarrierCode
Instead of passing multiple fields (carrier, carrier account, parcel type, service, and special services) every time in your request payload, you can:
Generate a Custom Carrier Code once, with all those values defined.
Use that single code in your create shipment requests.
The carrier, account, service, parcel type, and special service values from that code will then automatically apply.
If parcel type, service, or special services are also passed in the request payload, they will be overridden by the values defined in the Custom Carrier Code.
Notes
The rateShopBy field determines the variant to use (carrier, ruleSet, or rateGroup).
Ensure that variant-specific fields are correctly populated:
carrierAccountId, carrier, and serviceruleType and shipOptionruleType and rateGroupIdcodeDefine 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.
required | object (fromAddressV2) The complete address of the Sender. |
required | object (toAddressV2) The complete address of the Recipient or Department (in case if the address is not pointed to any individual recipient). |
object (soldToAddressV2) Billing address of the buyer responsible for the shipment payment. It can be domestic or international address.
| |
Array of objects (additionalAddresses) A list of additional addresses associated with the shipment.
| |
object This is an optional field. if a package shipped from Location_A to Location_B needs to return to Location_C. The alternate address will be printed on the label. Use this object to specify a return address different from the fromAddress. Supported by FedEx, UPS, and Purolator. | |
object (parcelV2) The details of the Parcel. | |
| parcelType required | string Parcel Type is required for creating a shipment while rating a parcel, which varies as per Carrier selection. |
| rateShopBy required | string RateShop, which is attached to an Enterprise or Location, is done through four approaches: by Carrier, by RateGroup, by RuleSet and by CustomCarrierCode**. |
object (byCarrierV2) The shipment is grouped by Carrier and their Service. | |
object Shipment Options have an added feature that is Manifest. | |
Array of FedEx Carrier Payment (object) or UPS Carrier Payment (object) or DHL Express Carrier Payment (object) (carrierPayments) Defines how carrier charges are billed to a third party. Use this field to specify account and charge type details for transportation and/or duties and taxes. This field is optional and currently supported for FedEx, UPS, and DHL Express.
| |
object This option is used to provide additional information into the label's additional space. It is supported only for doc size | |
Array of objects (SpecialService) It provides a carrier based special or extra service, which also varies as per selected service and parcel type. User can override this value by defining it at shipment level.
| |
object Indicates the supporting special service or document as an evidence of shipment delivery.
For the delivery confirmation, user can select any of the following special services, but they may vary as per the carrier selection.
Carrier specific options:
| |
object Few shipments need a special handling, and the reason can be fragile items or highly secured shipments. There might be other case scenarios. In a simple term, this field defines shipment handling, which provides users a capability to select handling options.
Carrier specific options:
| |
object Indicates the insurance coverage, which is selected by users while create shipment - rate shopping. User can select below-mentioned special service for insurance:
Carrier specific options:
| |
object (referenceV2) References are tags or information that is printed on Shipping Label based on the customer's requirement. | |
Array of objects Additional metadata that needs to be stored for this shipment can be added here. | |
| labelSize required | string Defines the label size of the Shipment, that is, the Shipping Label is available in different Doc Size. |
| labelType required | string Defines the type of the Shipment. QR_CODE supported for carrier USPS only as of now. |
| labelFormat required | string "Defines the file/format in which the label is printed. |
| contentType | string Specifies how the label content is encoded. |
| printerAliasName | string Refers to a printer connected (directly or via network) to a computer. |
| dateOfShipment | string <date> The date when shipment is created/shipped. The format of the Date is YYYY-MM-DD. |
object There are two options of delivery: deliverBy and useBestNextDate, where customer can schedule the delivery date in deliverBy. | |
object This object defines return shipment options. It should be passed when requesting return labels. Supported only for carriers UPS and FedEx as of now. For UPS, this object is required. For FedEx, this object is optional. Note: The
| |
object Customs information required for international shipments.
|
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,
- "declarationId": "USA1006189",
- "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": "costAccountName"
}, - {
- "name": "costAccountId",
- "value": "costAccountId"
}, - {
- "name": "costAccountCode",
- "value": "Code"
}, - {
- "name": "accountCode",
- "value": "code"
}, - {
- "name": "companyCode",
- "value": "code"
}
]
], - "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"
}
]
}