Skip to content

Developers

Card generation API

One authenticated POST returns a print-ready front and back card. Each call debits your wallet at the current card price.

Getting started

  1. Create a key at Account → API keys.
  2. Top up your wallet — calls fail with 402 when the balance is too low.
  3. Send the request below. Keys look like dlk_…; treat them as secrets.

Endpoint

POST https://dlcardgenerator.cloud/api/v1/generate

Headers: Authorization: Bearer dlk_…, Content-Type: application/json

Request body

{
  "template": "blue",          // or "white"           (optional)
  "save": false,               // store for 30 days + return URLs (optional)
  "front": {
    "dlNumber": "UP40 20250001672",   // required
    "holderName": "ARVIND KUMAR",      // required
    "fatherName": "PANCHDEV",
    "dob": "10-04-2001",
    "issueDate": "07-02-2025",
    "validityNT": "09-04-2041",
    "validityTR": "10-05-2031",
    "address": "…",
    "bloodGroup": "B+",
    "stateCode": "UP",
    "issuedByGovt": "BIHAR",
    "photo": "data:image/jpeg;base64,…",     // or an https URL
    "signature": "data:image/png;base64,…"
  },
  "back": {
    "mobile": "7398392481",
    "authorityName": "Nibedita Kumari",
    "officeType": "DTO",
    "dtoLocation": "GOPALGANJ",
    "vehicleClasses": [
      { "code": "LMV", "issuedBy": "UP40", "issueDate": "07-02-2025", "category": "NT" },
      { "code": "MCWG", "issuedBy": "UP40", "issueDate": "07-02-2025", "category": "NT" }
    ]
  }
}

Response

save: false → base64 PNGs (ephemeral):

{
  "ok": true,
  "generation_id": "…",
  "template": "blue",
  "price": 1,
  "balance": 42,
  "saved": false,
  "images": {
    "front": "data:image/png;base64,…",
    "back":  "data:image/png;base64,…"
  }
}

save: true → images.front_url / images.back_url (signed, 1 hour).

Errors

  • 401 unauthorized — bad or missing key
  • 402 insufficient — top up your wallet
  • 403 api_disabled / account_restricted
  • 429 rate_limited — per-key limit (default 30/min), or monthly_cap
  • 400 invalid_request — see fields
  • 502 render_failed — renderer error; you are not charged

Example

curl -X POST https://dlcardgenerator.cloud/api/v1/generate \
  -H "Authorization: Bearer $DLK" \
  -H "Content-Type: application/json" \
  -d '{"front":{"dlNumber":"UP40 20250001672","holderName":"ARVIND KUMAR"}}' \
  | jq -r '.images.front' | sed 's/^data:image\/png;base64,//' | base64 -d > front.png
Generated cards are formatting aids for personal use only — not valid for official use. You are responsible for the accuracy and lawful use of the data you submit. See the Acceptable Use Policy.