Create a Label
The API endpoint /v1/labels/ returns a label for the specified carrier along with the service class and tracking number.
The example request and response in this document also includes the property validate_address
, which users on ShipEngine's Free plan can use to access the address validation functionality.
ShipEngine's Advanced plan and above also have access to the endpoint /v1/addresses/validate.
Example
Example Request
POST /v1/labels/
12345678910111213141516171819202122232425262728293031323334353637383940414243
POST /v1/labels HTTP/1.1Host: api.shipengine.comAPI-Key: __YOUR_API_KEY_HERE__Content-Type: application/json{"shipment": {"validate_address": "validate_and_clean","service_code": "usps_priority_mail","ship_from": {"name": "John Doe","company_name": "Example Corp.","address_line1": "4009 Marathon Blvd","city_locality": "Austin","state_province": "TX","postal_code": "78756","country_code": "US","phone": "512-555-5555"},"ship_to": {"name": "Amanda Miller","address_line1": "525 S Winchester Blvd","city_locality": "San Jose","state_province": "CA","postal_code": "95128","country_code": "US"},"packages": [{"weight": {"value": 17,"unit": "pound"},"dimensions": {"length": 36,"width": 12,"height": 24,"unit": "inch"}}]}}'
Example Response
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
{"label_id": "se-392157963","status": "completed","shipment_id": "se-1053748895","ship_date": "2023-12-20T08:00:00Z","created_at": "2023-12-20T18:02:07.7650796Z","shipment_cost": {"currency": "usd","amount": 175.0400},"insurance_cost": {"currency": "usd","amount": 0.0},"requested_comparison_amount": {"currency": "usd","amount": 0.0},"rate_details": [],"tracking_number": "9405511899562082413495","is_return_label": false,"rma_number": null,"is_international": false,"batch_id": "","carrier_id": "se-4712287","service_code": "usps_priority_mail","package_code": "package","voided": false,"voided_at": null,"label_format": "pdf","display_scheme": "label","label_layout": "4x6","trackable": true,"label_image_id": null,"carrier_code": "stamps_com","tracking_status": "in_transit","label_download": {"pdf": "https://api.shipengine.com/v1/downloads/10/wpTzhiFW9ke8L-_6rJHmEA/label-392157963.pdf","png": "https://api.shipengine.com/v1/downloads/10/wpTzhiFW9ke8L-_6rJHmEA/label-392157963.png","zpl": "https://api.shipengine.com/v1/downloads/10/wpTzhiFW9ke8L-_6rJHmEA/label-392157963.zpl","href": "https://api.shipengine.com/v1/downloads/10/wpTzhiFW9ke8L-_6rJHmEA/label-392157963.pdf"},"form_download": null,"qr_code_download": null,"insurance_claim": null,"packages": [{"package_id": 410478985,"package_code": "package","weight": {"value": 17.00,"unit": "pound"},"dimensions": {"unit": "inch","length": 36.00,"width": 12.00,"height": 24.00},"insured_value": {"currency": "usd","amount": 0.00},"tracking_number": "9405511899562082413495","qr_code_download": null,"label_messages": {"reference1": null,"reference2": null,"reference3": null},"external_package_id": null,"content_description": null,"sequence": 1,"alternative_identifiers": []}],"charge_event": "carrier_default","alternative_identifiers": []}