Create a Label from a Sales Order

Example

POST /v-beta/labels/sales_order/:sales_order_id

curl -iX POST https://api.shipengine.com/v-beta/labels/sales_order/:sales_order_id \
-H 'Content-Type: application/json' \
-H 'API-Key: __YOUR_API_KEY_HERE__' \
-d '
{
  "test_label": false,
  "label_format": "pdf",
  "shipment": {
    "carrier_id": "se-123890",
    "service_code": "usps_priority_mail",
    "ship_from": {
      "name": "Dade Murphy",
      "phone": "512-485-4282",
      "company_name": "Zero Cool",
      "address_line1": "345 Chambers Street",
      "address_line2": "Suite 100",
      "city_locality": "New York City",
      "state_province": "NY",
      "postal_code": "10282",
      "country_code": "US",
    },
    "packages": [
      {
        "package_code": "package",
        "weight": {
          "value": 1,
          "unit": "ounce"
        }
      }
    ]
  }
}'
{
  "label_id": "se-419215",
  "status": "completed",
  "shipment_id": "se-2116034",
  "ship_date": "2019-07-25T05:00:00.000Z",
  "created_at": "2019-07-25T15:24:46.657Z",
  "shipment_cost": {
    "currency": "USD",
    "amount": 6.86
  },
  "insurance_cost": {
    "currency": "USD",
    "amount": 0.0
  },
  "tracking_number": "9405511899560441854156",
  "is_return_label": false,
  "is_international": false,
  "batch_id": "",
  "carrier_id": "se-123890",
  "service_code": "usps_priority_mail",
  "package_code": "package",
  "voided": false,
  "label_format": "pdf",
  "label_layout": "4x6",
  "trackable": false,
  "carrier_code": "stamps_com",
  "tracking_status": "unknown",
  "label_download": {
    "href": "https://api.shipengine.com/v1/downloads/8G1sj2vKeU2yfmsk1NquXQ/label-12893.pdf"
  },
  "form_download": null,
  "insurance_claim": null,
  "packages": [
    {
      "package_code": "package",
      "weight": {
        "value": 1.00,
        "unit": "ounce"
      },
      "dimensions": {
        "unit": "inch",
        "length": 0.0,
        "width": 0.0,
        "height": 0.0
      },
      "insured_value": {
        "currency": "usd",
        "amount": 0.00
      },
      "tracking_number": null,
      "label_messages": {
        "reference1": null,
        "reference2": null,
        "reference3": null
      }
    }
  ]
}