This guide explains how to create a shipping label from a sales order ID using the ShipEngine API beta endpoint.
Before using this endpoint, you need to be familiar with:
- Getting started with orders and the Sales Order API
- How to obtain a
carrier_idby listing carriers - How to get a
service_codeby listing carrier services
POST /v-beta/labels/sales_order/:sales_order_id
POST /v-beta/labels/sales_order/:sales_order_id HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
Content-Type: application/json{
"label_format": "pdf",
"shipment": {
"carrier_id": "se-123890",
"service_code": "usps_priority_mail",
"ship_from": {
"company_name": "Example Corp.",
"name": "John Doe",
"phone": "111-111-1111",
"address_line1": "4009 Marathon Blvd",
"city_locality": "Austin",
"state_province": "TX",
"postal_code": "78756",
"country_code": "US"
},
"packages": [{
"package_code": "package",
"weight": {
"value": 2,
"unit": "pound"
}
}]
}
}The API returns a comprehensive label object containing:
label_idandshipment_id- Shipment and insurance costs in USD
- Tracking number
- Label format and layout specifications
- Download link for the label PDF
- Package details with dimensions and weight
- Status information (completed, voided, trackable, etc.)
The response includes boolean flags like:
is_return_labelis_internationalvoidedtrackable
And detailed cost breakdowns for both shipment and insurance.