Create a Shipment with Sales Order Items

Example

POST /v-beta/shipments

curl -iX POST https://api.shipengine.com/v-beta/shipments/ \
-H 'Content-Type: application/json' \
-H 'API-Key: __YOUR_API_KEY_HERE__' \
-d '
{
  "shipments": [
    {
      "validate_address": "validate_and_clean",
      "carrier_id": "se-2565",
      "service_code": "usps_priority_mail",
      "ship_to": {
        "name": "Mickey and Minnie Mouse",
        "phone": "+1 (714) 781-4565",
        "company_name": "The Walt Disney Company",
        "address_line1": "500 SOUTH BUENA VISA STREET",
        "address_line2": "",
        "city_locality": "BURBANK",
        "state_province": "CA",
        "postal_code": "91521-0001",
        "country_code": "US",
        "address_residential_indicator": "No"
      },
      "warehouse_id": "se-1951",
      "packages": [
        {
          "package_code": "package",
          "weight": {
            "value": 1.0,
            "unit": "ounce"
          }
        }
      ],
      "items": [
        {
          "sales_order_id": "0351523b-1955-5259-a5a5-e63b7336e738",
          "sales_order_item_id": "eeda0203-1380-5cf3-a6fd-8b405d0e5bfb",
          "quantity": 1
        }
      ]
    }
  ]
}'

warning

Sales Order Items SKU and Name

When including sales_order_id and sales_order_item_id, ShipEngine will not automatically populate the SKU and name of the item. However, you may manually add these values and they will be persisted.

{
  "has_errors": false,
  "shipments": [
    {
      "sales_order_ids": [
        "0351523b-1955-5259-a5a5-e63b7336e738"
      ],
      "items": [
        {
          "sales_order_id": "0351523b-1955-5259-a5a5-e63b7336e738",
          "sales_order_item_id": "eeda0203-1380-5cf3-a6fd-8b405d0e5bfb",
          "quantity": 1,
          "name": "things",
          "sku": "things-sku",
          "created_at": "2018-01-30T20:43:04.7751179Z",
          "modified_at": "2018-01-30T20:43:04.7751179Z"
        }
      ],
      "errors": [],
      "address_validation": {
        "status": "verified",
        "original_address": {
          "name": "Mickey and Minnie Mouse",
          "phone": "+1 (714) 781-4565",
          "company_name": "The Walt Disney Company",
          "address_line1": "500 SOUTH BUENA VISA STREET",
          "address_line2": "",
          "address_line3": null,
          "city_locality": "BURBANK",
          "state_province": "CA",
          "postal_code": "91521-0001",
          "country_code": "US",
          "address_residential_indicator": "no"
        },
        "matched_address": {
          "name": "MICKEY AND MINNIE MOUSE",
          "phone": "+1 (714) 781-4565",
          "company_name": "THE WALT DISNEY COMPANY",
          "address_line1": "500 SOUTH BUENA VISA STREET",
          "address_line2": "",
          "address_line3": null,
          "city_locality": "BURBANK",
          "state_province": "CA",
          "postal_code": "91521-0001",
          "country_code": "US",
          "address_residential_indicator": "no"
        },
        "messages": []
      },
      "shipment_id": "se-1150920",
      "carrier_id": "se-2565",
      "service_code": "usps_priority_mail",
      "external_shipment_id": null,
      "ship_date": "2019-07-25T05:00:00.000Z",
      "created_at": "2019-07-25T15:24:46.657Z",
      "modified_at": "2019-07-25T15:24:46.657Z",
      "shipment_status": "pending",
      "ship_to": {
        "name": "MICKEY AND MINNIE MOUSE",
        "phone": "+1 (714) 781-4565",
        "company_name": "THE WALT DISNEY COMPANY",
        "address_line1": "500 SOUTH BUENA VISA STREET",
        "address_line2": "",
        "address_line3": null,
        "city_locality": "BURBANK",
        "state_province": "CA",
        "postal_code": "91521-0001",
        "country_code": "US",
        "address_residential_indicator": "no"
      },
      "ship_from": {
        "name": "Dade Murphy",
        "phone": "512-485-4282",
        "company_name": "Zero Cool",
        "address_line1": "345 Chambers Street",
        "address_line2": "Suite 100",
        "address_line3": null,
        "city_locality": "New York City",
        "state_province": "NY",
        "postal_code": "10282",
        "country_code": "US",
        "address_residential_indicator": "unknown"
      },
      "return_to": {
        "name": "Dade Murphy",
        "phone": "512-485-4282",
        "company_name": "Zero Cool",
        "address_line1": "345 Chambers Street",
        "address_line2": "Suite 100",
        "address_line3": null,
        "city_locality": "New York City",
        "state_province": "NY",
        "postal_code": "10282",
        "country_code": "US",
        "address_residential_indicator": "unknown"
      },
      "packages": [
        {
          "package_code": "package",
          "weight": {
            "value": 1,
            "unit": "ounce"
          },
          "dimensions": {
            "unit": "inch",
            "length": 0,
            "width": 0,
            "height": 0
          },
          "insured_value": {
            "currency": "usd",
            "amount": 0
          },
          "label_messages": {
            "reference1": null,
            "reference2": null,
            "reference3": null
          }
        }
      ],
      "total_weight": {
        "value": 1,
        "unit": "ounce"
      }
    }
  ]
}