Creating Orders

ShipBob’s Order POST endpoint has several required fields that you need to be aware of:

  • Shipping method: This is typically a value such as “Standard”, “Expedited”, “2-Day”, etc. Once a ship method comes through via the integration, the merchant will have the ability to map the method to a specific Ship Option that will determine the shipment’s SLA and carrier selection. More detail on Ship Options can be found in our help center here.
  • Recipient name - The name of the individual the shipment will be delivered to.
  • Recipient address – specifically the Address1, City, and Country (ISO Alpha-2 code is highly recommended). If available, please also pass the City and Zip Code.
  • Reference id – This is a unique order number from the upstream platform being integrated with ShipBob. This number must be unique within ShipBob account. You can also pass an optional order_number field. This does not need to be unique, and is a more user-friendly order number that a customer service agent might be more familiar with.
  • Products – There are two methods for providing product data with your order payload to ShipBob:
    • ReferenceId Model (highly recommended) – This model allows you to pass a product’s reference_id (typically the SKU value), as well as the product name. When an order is created, ShipBob will check if the product already exists based on a matching reference_id, and will automatically create a new product if one does not already exist. This model is recommended as you do not need to store any external ShipBob product id values to create an order successfully. It also has the ability to auto-create products if they do not exist based on the duplicate match of a reference_id value.
    • ProductId Model – This model requires that you pass ShipBob’s ProductId as part of the order payload to create the order. This will mean that you first must create a product using ShipBob’s Product API and have a method to either store or reference the ShipBob-generated ProductId to use as part of your order creation process.
      • This model works best if you always create products in ShipBob prior to sending any orders, and have a way to store the ProductId somewhere upstream.

When viewing the API documentation, you can toggle between each model by expanding the Product node:

In addition to the required fields highlighted above, you also have the ability to pass order tags to ShipBob. Tags are an array that consists of a name, value pair which can be used to store additional data that might be needed with your platform upstream, and can also trigger automation rules that have been created in ShipBob.

More details on available rules can be found here.

To trigger a rule created within ShipBob, the order tag name must match the rule. As an example, if you desire to pass a tag that triggers a rule to automatically add a marketing insert to specific orders, your tag structure may look like:

"tags": [
  {
    "name": "AddMarketingInsert",
    "value": "NotUsedForRuleTrigger"
  },
  {
    "name": "Subscription First Order",
    "value": "0"
  }
],

Where the tag “name” value of “AddMarketingInsert” is what will be used to trigger a rule created in ShipBob.

Lastly, you will need to also specify a shipbob_channel_id within the request header to successfully create an order. To find which channel you have write access to, you can call the GET Channel endpoint to view a list of permissions you have access to under each channel. You will only have write access for one channel (your own integration channel), but you typically will have the ability to read data across other channels.

Sample requests

Creating B2B orders

ShipBob has the ability to ingest generic B2B orders via the public API. Please note that these are B2B orders which do not have retailer compliance standards, ShipBob standard packing slips, boxes, GS1 labels will be used for these orders. If you are working with retailers that have compliance guideles that ShipBob must adhere to, please reach out to your Merchant Success Manager for additional assistance.

Generic B2B orders passing through ShipBob’s API must be sent with specific required fields to ensure they fall under our B2B flow as opposed to the default D2C flow.

Attached, you will find an example API request for a general b2b order. While reviewing this example, there are several fields to note within this payload that differ from a standard D2C order:

  • Ensure that the type is set to a value of 2 or “B2B” (this denotes a B2B order type).
  • carrier_type will be either “Parcel” or “Freight” – recommended that you have the ability to select which of these options should be used.
  • shipping_method should be “B2B”.
  • payment_terms can either be “Prepaid” or “MerchantResponsible”.
    • This depends if you will be uploading your own labels on the ShipBob dashboard, or if ShipBob will provide the labels. If ShipBob will handle labels, then pass the value “Prepaid”.
  • retailer_program_type should be set to “SB-B2B”.
  • Pass a purchase_order_number.
  • company_name within the recipient address data should be the retailer’s name.
  • quantity_unit_of_measure_code should be “EA” for eaches

Sample request

Create B2B Order
{
  "shipping_method": "Standard",
  "recipient": {
    "name": "John Doe",
    "address": {
      "address1": "100 Nowhere Blvd",
      "address2": "Suite 100",
      "city": "Gotham City",
      "state": "NJ",
      "zip_code": "07093",
      "country": "US"
    },
    "email": "[email protected]"
    "phone_number": "9998887777"
  },
  "reference_id": "10001",
  "order_number": "10001",
  "purchase_date": "2024-09-22T23:00:48Z",
  "type": "B2B",
  "retailer_program_data": {
    "purchase_order_number": "10001"
    "retailer_program_type": "SB-B2B",
    "mark_for_store": null,
    "department": null,
    "delivery_date": null,
    "addresses": [],
    "customer_ticket_number": null
  },
  "products": [
    {
      "name": "Test SKU",
      "sku": "test-sku",
      "reference_id": "test-sku",
      "quantity": "1"
    }
  ]
}