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
rateShopBy
field determines the variant to use (carrier
, ruleset
, or rategroup
).carrierAccountId
, carrier
, and service
ruleType
and shipOption
ruleType
and rateGroupId
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": "3010 Summer Street",
- "addressLine2": "near abc street",
- "addressLine3": "near xyz street",
- "company": "PB",
- "email": "testuser@gmail.com",
- "phone": "416 123-4567",
- "cityTown": "OTTAWA",
- "stateProvince": "ON",
- "postalCode": "K1A0B2",
- "inductionPostalCode": "06905",
- "countryCode": "CA",
- "residential": true
}, - "toAddress": {
- "name": "Recipient Name",
- "addressLine1": "771 Atlantic Ave",
- "addressLine2": "near abc street",
- "addressLine3": "near xyz street",
- "cityTown": "BRAMPTON",
- "stateProvince": "ON",
- "postalCode": "L6Y 2N4",
- "countryCode": "CA",
- "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",
- "taxId": "string",
- "taxIdType": "EIN"
}, - "additionalAddresses": [
- {
- "address": {
- "residential": false,
- "phone": "732-443-1007",
- "countryCode": "US",
- "postalCode": "08810-1411",
- "cityTown": "DAYTON",
- "name": "Warehouse Manager",
- "stateProvince": "NJ",
- "addressLine1": "2270 US HIGHWAY 130"
}, - "addressType": "BROKER"
}
], - "altReturnAddress": {
- "addressLine1": "3010 Summer Street",
- "addressLine2": "near abc street",
- "addressLine3": "near xyz street",
- "company": "PB",
- "email": "user@email.com",
- "residential": true,
- "cityTown": "OTTAWA",
- "countryCode": "CA",
- "name": "User Name",
- "phone": "4161234567",
- "postalCode": "K1A0B2",
- "stateProvince": "ON"
}, - "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,
- "shipperID": "1234567890"
}, - "carrierPayments": [
- {
- "accountNumber": "602684342",
- "countryCode": "US",
- "party": "BILL_THIRD_PARTY",
- "postalCode": "30305",
- "typeOfCharge": "TRANSPORTATION_CHARGES"
}
], - "docTab": {
- "templateName": "1",
- "toAddressName": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "parcelTrackingNumber": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "carrier": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "serviceId": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "dateOfShipment": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "pieceNumber": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "packageTotalCarrierCharge": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "totalCarrierCharge": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "packageWeight": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "totalWeight": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "customField1": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "customField2": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "customField3": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}, - "customField4": {
- "displayName": "TO",
- "value": "Test1",
- "row": 1,
- "column": 1
}
}, - "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"
}
]
}
}
{- "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
}, - "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": "3010 Summer Street",
- "addressLine2": "near abc street",
- "addressLine3": "near xyz street",
- "company": "PB",
- "email": "testuser@gmail.com",
- "phone": "416 123-4567",
- "cityTown": "OTTAWA",
- "stateProvince": "ON",
- "postalCode": "K1A0B2",
- "inductionPostalCode": "06905",
- "countryCode": "CA",
- "residential": true
}, - "toAddress": {
- "name": "Recipient Name",
- "addressLine1": "771 Atlantic Ave",
- "addressLine2": "near abc street",
- "addressLine3": "near xyz street",
- "cityTown": "BRAMPTON",
- "stateProvince": "ON",
- "postalCode": "L6Y 2N4",
- "countryCode": "CA",
- "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",
- "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"
}, - "carrierPayments": [
- {
- "accountNumber": "602684342",
- "countryCode": "US",
- "party": "BILL_THIRD_PARTY",
- "postalCode": "30305",
- "typeOfCharge": "TRANSPORTATION_CHARGES"
}
]
}