production ready

Etykietki
API

Generate shipping labels for parcel lockers and courier deliveries. Simple REST API with balance tracking.

POST /api.php?method=generate

API Key Auth

X-API-Key header with your unique key

Instant Labels

PDF labels download via URL

$1.00 / Label

Automatic balance deduction

Authentication

Include your API key in the request header:

X-API-Key: twoj_klucz_api_z_telegrama

Endpoints

GET/api/balance

Returns 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/generate

Generate 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/history

Returns 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.pdf
browser
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

ErrorDescription
API key requiredMissing X-API-Key header
Invalid API keyAPI key not recognized
Insufficient balanceBalance below $1.00
No active sessionInPost session expired
Label generation failedInPost API error
https://etyk.vercel.app/

base url