Getting started
- Create a key at Account → API keys.
- Top up your wallet — calls fail with
402when the balance is too low. - 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 key402 insufficient— top up your wallet403 api_disabled/account_restricted429 rate_limited— per-key limit (default 30/min), ormonthly_cap400 invalid_request— seefields502 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