Create a Shipment

Creating a Shipment

This JSON schema is your go-to guide for integrating with our system to create shipments, whether you're shipping internationally or domestically. It covers everything you need, from shipment references and customer info to package details. You can include multiple items in a shipment, each with its own SKU, price, and size. Plus, it’s got sections for shipping and vendor details, along with spots for any extra notes and label references. Basically, it’s everything you need to make sure your shipments get processed smoothly, labels get generated, and tracking is a breeze.


Create Shipment API Request Structure

PropertyTypeDescriptionUnits
shipment_referenceStringUnique identifier for the shipment.
additional_shipment_referenceStringAdditional reference number for the shipment.
customer_referenceStringCustomer’s reference number.
process_labelBooleanIndicates whether to process and generate a label (true/false).
label_typeStringType of label to be generated. Options: "pdf", "zpl".
service_codeStringCode representing the shipping service to be used.
store_idStringIdentifier for the store or location from which the shipment is originating.
client_idStringUnique identifier for the client.
processing_locationStringLocation where the shipment will be processed (e.g., "LAX").
pre_processBooleanIndicates if the shipment should be pre-processed before the final processing (true/false).
shipment_typeStringType of shipment. Options: "domestic", "international".
transaction_typeStringType of transaction. Example: "B2BDDP" (Business to Business Delivery Duty Paid).
dangerous_goodsBooleanIndicates if the shipment contains dangerous goods (true/false).
contents.items[]Array of ObjectsArray of items contained within the shipment.
contents.items[].skuStringStock Keeping Unit identifier for the item.
contents.items[].quantityIntegerQuantity of the item being shipped.
contents.items[].priceStringPrice of a single item.
contents.items[].currencyStringCurrency code (e.g., "USD").
contents.items[].descriptionStringDescription of the item.
contents.items[].country_of_originStringCountry where the item was manufactured or produced.
contents.items[].harmonized_tariff_codeStringHarmonized Tariff Code for the item.
contents.items[].original_harmonized_codeStringOriginal harmonized code used before any modifications.
contents.items[].package_referenceStringReference for the package containing this item.
contents.items[].productStringName of the product.
contents.items[].product_codeStringCode representing the product.
contents.items[].weightStringWeight of the item (typically in pounds).LBS
contents.items[].dimensionsObjectDimensions of the item.
contents.items[].dimensions.lengthStringLength of the item in the package.inch
contents.items[].dimensions.heightStringHeight of the item in the package.inch
contents.items[].dimensions.widthStringWidth of the item in the package.inch
ship_toObjectObject containing the recipient's shipping information.
ship_to.nameStringName of the recipient.
ship_to.phoneStringPhone number of the recipient.
ship_to.emailStringEmail address of the recipient.
ship_to.address_line1StringFirst line of the recipient's address.
ship_to.address_line2StringSecond line of the recipient's address (optional).
ship_to.city_localityStringCity or locality of the recipient's address.
ship_to.state_provinceStringState or province of the recipient's address.
ship_to.postal_codeStringPostal or ZIP code of the recipient's address.
ship_to.country_codeStringISO country code of the recipient's address.
vendorObjectObject containing the vendor's information.
vendor.nameStringName of the vendor.
vendor.companyStringCompany name of the vendor.
vendor.phoneStringPhone number of the vendor.
vendor.emailStringEmail address of the vendor.
vendor.address_line1StringFirst line of the vendor's address.
vendor.address_line2StringSecond line of the vendor's address (optional).
vendor.city_localityStringCity or locality of the vendor's address.
vendor.state_provinceStringState or province of the vendor's address.
vendor.postal_codeStringPostal or ZIP code of the vendor's address.
vendor.country_codeStringISO country code of the vendor's address.
packages[]Array of ObjectsArray of packages included in the shipment.
packages[].package_referenceStringUnique reference for the package.
packages[].br_tracking_idStringTracking ID for the package.
packages[].weightStringWeight of the package.lbs
packages[].dimensionsObjectDimensions of the package.
packages[].dimensions.lengthStringLength of the package.inch
packages[].dimensions.heightStringHeight of the package.inch
packages[].dimensions.widthStringWidth of the package.inch
metadata[]Array of ObjectsArray of metadata objects for additional information.
metadata[].nameStringName of the metadata field.
metadata[].typeStringType of the metadata value (e.g., "string", "number").
metadata[].valueStringValue of the metadata field.
label_reference[]Array of ObjectsArray of references related to the labels.
label_reference[].referenceStringReference identifier for the label.


Request

curl -X POST "https://brdrch.com/api/v1/shipments" \
-u "cd3b3de84cc1ee040bf06512d233719c" \
-d '{}'
{
  "shipment_reference": "1daa0c22",
  "additional_shipment_reference": "112302152233",
  "customer_reference": "1451451547",
  "process_label": true,
  "label_type": "pdf", // "zpl"
  "service_code": "BRCExp",
  "store_id":"24",
  "client_id": "12546254",
  "processing_location": "LAX",
  "pre_process": true,
  "shipment_type": "domestic",
  "transaction_type": "B2BDDP",
  "dangerous_goods": true,
  "contents": {
    "items": [
      {
        "sku": "4225-776-3234",
        "quantity": 4,
        "price": 10.99,
        "currency": "USD",
        "description": "Mens Polo Shirt Cotton",
        "country_of_origin": "US",
        "harmonized_tariff_code": "4817.20",
        "original_harmonized_code": "234434",
        "package_reference": "ABC1234",      
        "weight": 10,
        "dimensions": {
           "length": 10,
           "height": 10,
           "width": 10
        }
      }
    ]
  },
  "ship_to": {
    "name": "James Cameron",
    "phone": "555-555-5555",
    "email": "[email protected]",
    "address_line1": "655 Queen Street West",
    "address_line2": "apt 123",
    "city_locality": "Toronto",
    "state_province": "ON",
    "postal_code": "M6J 1E4",
    "country_code": "CA"
  },
  "vendor": {
    "name": "Hotwheels",
    "company": "Mattel Inc.",
    "phone": "444-444-4444",
    "email": "[email protected]",
    "address_line1": "454 GATEWAY CRES SOUTH",
    "address_line2": "",
    "city_locality": "LETHBRIDGE",
    "state_province": "AB",
    "postal_code": "T1K4X2",
    "country_code": "CA"
  },
  "packages": [
    {
      "package_reference": "ABC1234",
      "br_tracking_id":"BR23445634532",
      "weight": 10,
      "dimensions": {
        "length": 10,
        "height": 10,
        "width": 10
      },
      "product" : "e-PAQ Select Pre Alert Canada FTA",
      "product_code": "A1207",  
    },
    {
      "package_reference": "4567",
      "br_tracking_id":"BR23445634533",
      "weight": 10,
      "dimensions": {
        "length": 10,
        "height": 10,
        "width": 10
      },
      "product" : "e-PAQ Select Pre Alert Canada FTA",
      "product_code": "A1207",  
    }
  ],
  "metadata": [
    {
      "name": "notes",
      "type": "string",
      "value": "delivery notes"
    }
  ],
  "label_reference":[
    {"reference":"reference one"},
    {"reference":"reference two"},
    {"reference":"reference three"}
  ]
}
{
  "code": "InvalidArgument",
  "message": {
    "error": 1900,
    "message": "One or more parameters required for this request are either missing or have an invalid format.",
    "cause": "Team IDs array missing",
    "request": "bc41a8eb-a604-4a1c-aa5a-e86a975c141b"
  }
}
{
  "code": "InvalidContent",
  "message": {
    "error": 1000,
    "message": "The values of one or more parameters are invalid.",
    "cause": "Invalid phone number format",
    "request": "fff8ed50-4ca0-4ff9-9230-b73096eb8502"
  }
}
{
  "code": "InvalidContent",
  "message": {
    "error": 1004,
    "message": "The values of one or more parameters break a uniqueness constraint.",
    "cause": {
      "type": "duplicateKey",
      "key": "unknown",
      "value": "unknown"
    },
    "request": "3eafc877-278c-40d1-993b-2acf2575c7d8"
  }
}

Response

{
  "shipment_reference": "1daa0c22",
  "additional_shipment_reference": "112302152233",
  "customer_reference": "1451451547",
  "process_label": true,
  "label_type": "pdf",
  "service_code": "BRCExp",
  "store_id":"24",
  "client_id": "12546254",
  "processing_location": "LAX",
  "shipment_type": "domestic",
  "transaction_type": "B2BDDP",
  "dangerous_goods": true,
  "contents": {
    "items": [
      {
        "sku": "4225-776-3234",
        "quantity": 4,
        "price": 10.99,
        "currency": "USD",
        "description": "Mens Polo Shirt Cotton",
        "country_of_origin": "US",
        "harmonized_tariff_code": "4817.20",
        "package_reference": "ABC1234",
        "weight": 10,
        "dimensions": {
           "length": 10,
           "height": 10,
           "width": 10
        }
      }
    ]
  },
  "ship_to": {
    "name": "James Cameron",
    "phone": "555-555-5555",
    "email": "[email protected]",
    "address_line1": "655 Queen Street West",
    "address_line2": "apt 123",
    "city_locality": "Toronto",
    "state_province": "ON",
    "postal_code": "M6J 1E4",
    "country_code": "CA"
  },
  "packages": [
    {
      "package_reference": "ABC1234",
      "weight": 10,
      "dimensions": {
        "length": 10,
        "height": 10,
        "width": 10
      },
      "product" : "e-PAQ Select Pre Alert Canada FTA",
      "product_code": "A1207",
      "sort_code":"BRE",
      "package_id":123,
      "carrier_tracking_number":"123456789012BR8447"
    },
    {
      "package_reference": "4567",
      "weight": 10,
      "dimensions": {
        "length": 10,
        "height": 10,
        "width": 10
      },
      "product" : "e-PAQ Select Pre Alert Canada FTA",
      "product_code": "A1207",
      "sort_code":"BRE",
      "package_id":321,
      "carrier_tracking_number":"123456789012BR8448"
    }
  ],
  "metadata": [
    {
      "name": "notes",
      "type": "string",
      "value": "delivery notes"
    }
  ],
  "label_reference":[
    {"reference":"reference one"},
    {"reference":"reference two"},
    {"reference":"reference three"}
  ],
  "label_download": [
    {
     "package_reference": "ABC1234",
     "br_tracking_id":"BR23445634532",
     "pdf": "https://api.brdrch.com/v1/downloads/10/XNGDhq7uZ0CAEt5LOnCxIg/label-7764944.pdf",
     "pdf_base64": "1791234h1239412h34-219u349u9128347123984h1234h-912834y12h381234yh123812348"
    },
    {
     "package_reference": "4567",
     "br_tracking_id":"BR23445634532",
     "pdf": "https://api.brdrch.com/v1/downloads/10/XNGDhq7uZ0CAEt5LOnCxIg/label-7764944.pdf",
     "pdf_base64": "1791234h1239412h34-219u349u9128347123984h1234h-912834y12h381234yh123812348"
    },
    {
      "br_tracking_id": "BR23445634532",
      "carrier_tracking_number": "123456789012BR8447",
      "carrier_tracking_link": "https://www.canadapost-postescanada.ca/track-reperage/en#/search?searchFor=123456789012BR8447",
      "zpl": "https://emaildata.dev.brdrch.com/argos/canadapost/zpl/123456789012BR8447.zpl",
      "zpl_base64": "XlhBDQpeQ0kxMw0KXk1..."
    }
   ]
}