Make shipping labels
The Shipping Label PDF API turns an address, package details, and a tracking code into a print-ready label with a scannable barcode, sized the way a carrier expects it. It's built for the exact moment an order is packed and needs a label attached before it leaves the building.
Run it online
Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.
A label has one job: scan correctly, every time
Unlike most documents, a shipping label isn't primarily read by a person — it's scanned by a handheld device or a conveyor-belt reader, which means the barcode has to be generated correctly, sized right, and placed where a scanner expects it, not just visually present. The shipping label api is built around that constraint: you send the shipment data, and what comes back is a label formatted for both a human glancing at it and a machine reading it in under a second.
What goes into a label request
You send the recipient's address, the sender's address, package details such as weight or dimensions if your layout uses them, and the tracking or reference code to encode. The service renders a compact PDF sized for standard label formats, with the barcode generated from your tracking code and placed with the margins a scanner and a carrier's system both expect — no manual alignment, no guessing at DPI.
How generation and delivery work
Call POST /pdf/label and you get a task_id back immediately, without holding a connection open while the label renders. It's built asynchronously on our global edge, and once ready you're notified by a signed webhook — a natural fit for a warehouse system that needs to send the label straight to a label printer the instant an order is packed — or by a signed link valid for 24 hours when someone just needs to print one label manually.
Where labels fit into fulfillment
Barcoded shipping labels became standard because manual sorting doesn't scale past a handful of packages a day; a scannable code lets a package move through a sorting facility without a person reading an address off it. This endpoint sits inside that same automation: an e-commerce platform generating a label the moment an order is marked ready to ship, a fulfillment center batching labels for a pick wave, a returns system issuing a prepaid label the instant a return is approved. Because each request is small and independent, a high-volume warehouse can generate many labels in parallel without one slow render holding up the rest.
Pricing built for volume
Labels are billed at a flat $0.002 per request — no per-document surcharge, priced for operations that generate labels by the hundreds or thousands. A failed generation is never charged; we retry three times before returning a clear error. Access requires prepaid balance, with no free tier or trial, which keeps the endpoint fast and abuse-free; requests without balance return 402. Shipment data is deleted after the retention window and never used for training.
What you can do with it
Order-ready label printing
An e-commerce platform generates a shipping label the instant an order is marked packed, sending it straight to the warehouse's label printer by webhook.
Batch labels for a pick wave
A fulfillment center generates labels for an entire wave of orders at once, printing them together right before the packages move to the dock.
Prepaid return labels
A returns portal issues a prepaid shipping label the moment a customer's return request is approved, ready to email or download.
Multi-carrier label generation
A shipping aggregator generates a correctly formatted label per carrier's requirements based on which carrier was selected for that shipment.
FAQ
How do I generate a shipping label with an API?
Send the recipient address, sender address, and tracking code to POST /pdf/label and you get a task_id back. The shipping label api renders the barcoded PDF asynchronously and delivers it by signed webhook or a signed link valid for 24 hours.
Is this API free?
There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.
Does the barcode actually scan correctly?
Yes. The barcode is generated from your tracking or reference code and placed with the sizing and margins a standard scanner expects, so it reads correctly on handheld and conveyor scanners.
Can I generate labels in bulk for a whole shipment batch?
Yes. The endpoint is asynchronous and each request is independent, so a fulfillment system can generate labels for an entire pick wave or order batch in parallel.
What size or format are the labels?
Labels render as compact, print-ready PDFs sized for standard shipping label formats, so they print correctly on typical label printers without manual resizing.
How is pricing different from other document types?
Labels are billed at a flat $0.002 per request with no per-document surcharge, reflecting that a label is a small, simple document generated at high volume.
What happens if label generation fails?
A failed task is never charged. We retry three times before returning a clear error, so you never pay for a label that wasn't produced.
How long can I access a generated label?
The signed link stays valid for 24 hours, or you can receive the PDF immediately by signed webhook for real-time printing. After the retention window it's deleted and never used for training.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/pdf/label \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"pdf":"https://ejemplo.com/documento.pdf"}'const res = await fetch("https://api.kit.forhosting.com/pdf/label", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"pdf": "https://ejemplo.com/documento.pdf"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/pdf/label",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"pdf": "https://ejemplo.com/documento.pdf"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/pdf/label", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"pdf":"https://ejemplo.com/documento.pdf"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"pdf":"https://ejemplo.com/documento.pdf"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/pdf/label", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"pdf": "https://ejemplo.com/documento.pdf"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "pdf.label",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_mb | 25 |
max_pages | 200 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
413 | input_too_large | The file exceeds the size limit. |