Etykietki
API
Authentication
Include your API key in the request header:
X-API-Key: twoj_klucz_api_z_telegramaEndpoints
GET
/api/balanceReturns current balance for your API key.
curl
curl -X GET "https://apietyk.vercel.app/api/balance" -H "X-API-Key: your_key"response
{
"success": true,
"balance": 15.50,
"user": {
"telegram_id": 123456789,
"telegram_username": "username",
"created_at": "2024-01-01 00:00:00"
}
}POST
/api/generateGenerate a shipping label. Cost: $1.00 per label.
Parcel Locker
{
"type": "p",
"gabaryt": "A",
"phone": "500123456",
"email": "customer@example.com",
"paczkomat": "KIE08A"
}Courier
{
"type": "k",
"gabaryt": "A",
"phone": "500123456",
"email": "customer@example.com",
"address": ["Jan", "Kowalski", "00-001", "Warszawa", "Marszalkowska 1"]
}response
{
"success": true,
"parcel_code": "642202809635326012183096",
"gabaryt": "A",
"pdf_url": "https://apietyk.vercel.app/api/download?code=642202809635326012183096",
"new_balance": 14.50
}⚠️ Download PDF: GET /api/download?code={parcel_code} (requires X-API-Key header)
GET
/api/historyReturns your label generation history (last 50 labels).
curl
curl -X GET "https://apietyk.vercel.app/api/history" -H "X-API-Key: your_key"response
{
"success": true,
"history": [
{
"label_code": "642202809635326012183096",
"type": "paczkomat",
"size": "A",
"created_at": "2024-01-01 12:00:00"
}
]
}GET
/api/download?code={parcel_code}Download a generated label as a PDF file. Just add your X-API-Key header and the PDF will download automatically.
curl
curl -X GET "https://apietyk.vercel.app/api/download?code=642202809635326012183096" -H "X-API-Key: your_key" --output label.pdfbrowser
fetch("https://apietyk.vercel.app/api/download?code=642202809635326012183096", {
headers: { "X-API-Key": "your_key" }
})
.then(res => res.blob())
.then(blob => {
const url = URL.createObjectURL(blob);
window.open(url, '_blank');
});✅ Just add X-API-Key header and the PDF downloads automatically.
Error Codes
| Error | Description |
|---|---|
| API key required | Missing X-API-Key header |
| Invalid API key | API key not recognized |
| Insufficient balance | Balance below $1.00 |
| No active session | InPost session expired |
| Label generation failed | InPost API error |
https://etyk.vercel.app/base url