Labels
A label represents a shipping label purchased for a specific shipment. Labels include a tracking number, barcode, and the formatted label image ready for printing.
Creating a label
curl -X POST https://api.flexops.io/v1/labels \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"carrier": "usps",
"service": "priority",
"from": {
"name": "Warehouse A",
"street1": "100 Shipping Lane",
"city": "Denver",
"state": "CO",
"zip": "80202",
"country": "US"
},
"to": {
"name": "Jane Doe",
"street1": "456 Oak Ave",
"city": "Portland",
"state": "OR",
"zip": "97201",
"country": "US"
},
"parcel": {
"weightOz": 16,
"lengthIn": 10,
"widthIn": 8,
"heightIn": 4
}
}'
Label response
{
"id": "lbl_abc123",
"trackingNumber": "9400111899223456789012",
"carrier": "usps",
"service": "priority",
"labelUrl": "https://api.flexops.io/v1/labels/lbl_abc123/download",
"labelFormat": "pdf",
"rate": {
"amount": 8.95,
"currency": "USD"
},
"status": "created",
"createdAt": "2026-03-10T12:00:00Z"
}
Label formats
| Format | Description |
|---|---|
pdf | Standard 4x6" PDF (default) |
png | 4x6" PNG image |
zpl | Zebra Printer Language (thermal printers) |
Specify the format with ?format=zpl when downloading.
Cancelling a label
Labels can be cancelled within the carrier's void window (typically 24 hours for domestic, varies for international):
curl -X POST https://api.flexops.io/v1/labels/lbl_abc123/cancel \
-H "X-API-Key: your-api-key"