{"id":95,"date":"2026-10-12T17:02:51","date_gmt":"2026-10-12T17:02:51","guid":{"rendered":"https:\/\/blog.skndan.com\/jsontoimg\/?p=95"},"modified":"2026-11-17T13:33:19","modified_gmt":"2026-11-17T13:33:19","slug":"how-to-create-a-certificate-generator-with-jsontoimg","status":"publish","type":"post","link":"https:\/\/blog.skndan.com\/jsontoimg\/2026\/10\/12\/how-to-create-a-certificate-generator-with-jsontoimg\/","title":{"rendered":"Certificate Generator with QR Code Verification: How to Build It"},"content":{"rendered":"<h1>How to Build a Certificate Generator with Verification QR Codes<\/h1>\n<blockquote>\n<p>Looking for the commercial API overview and pricing? Check out the primary <a href=\"https:\/\/jsontoimg.com\/use-cases\/certificates\">Certificate Generator API<\/a> hub.<\/p>\n<\/blockquote>\n<p>Certificates are essential milestones for modern SaaS platforms, online courses, bootcamps, and professional accreditations. When a student completes a course, they expect an immediate, high-resolution certificate with a verifiable credential ID and a scannable QR code.<\/p>\n<p>This tutorial walks through building a programmatic <strong>certificate generator<\/strong> with jsontoimg using Python or Node.js. By the end, you will have a pipeline that reads completion records from your database and renders print-ready vector PDFs and web-ready PNGs automatically.<\/p>\n<h2>Why Manual Certificate Workflows Fail<\/h2>\n<p>Most teams start with a graphic designer, a Figma or Canva template, and a spreadsheet. While manageable for 15 students, this approach breaks down at scale:<\/p>\n<ul>\n<li><strong>Time Drain<\/strong>: Exporting, naming, and emailing 500 certificates consumes 80\u2013120 hours of manual labor per cohort.<\/li>\n<li><strong>Typo Exposure<\/strong>: Human copy-paste errors on recipient names or dates undermine institutional credibility.<\/li>\n<li><strong>No Instant Verification<\/strong>: Manual exports lack verifiable cryptographic UUIDs and tamper-evident QR lookups.<\/li>\n<\/ul>\n<p>By treating certificates as a template driven by structured JSON, you turn graduation day into an automated 2-minute API background job.<\/p>\n<h2>Step 1: The Certificate Data Model<\/h2>\n<p>Every certificate requires a consistent JSON schema: recipient name, course title, completion date, credential UUID, and a verification URL:<\/p>\n<pre><code class=\"language-json\">{\n  &quot;certificate_id&quot;: &quot;0190a7e2-5b1c-7c3e-9f00-2a6d1e4b8c11&quot;,\n  &quot;recipient_name&quot;: &quot;Priya Sharma&quot;,\n  &quot;course_title&quot;: &quot;Advanced Distributed Systems&quot;,\n  &quot;instructor&quot;: &quot;Balaji R&quot;,\n  &quot;completion_date&quot;: &quot;2026-11-17&quot;,\n  &quot;verification_url&quot;: &quot;https:\/\/verify.example.com\/c\/0190a7e2-5b1c-7c3e-9f00-2a6d1e4b8c11&quot;\n}\n<\/code><\/pre>\n<p>In J2I Studio, design your certificate with dynamic text layers for <code>recipient_name<\/code>, <code>course_title<\/code>, <code>completion_date<\/code>, and <code>certificate_id<\/code>. Add a native <code>Code<\/code> layer named <code>qr<\/code> with format <code>qrcode<\/code>. Static elements (borders, emblems, background graphics, signatures) stay on fixed layers.<\/p>\n<h2>Step 2: Rendering a Single Certificate via REST<\/h2>\n<p>To issue a single certificate upon course completion, send a POST request to <code>\/api\/v1\/render<\/code>:<\/p>\n<pre><code class=\"language-bash\">curl -X POST &quot;https:\/\/app.jsontoimg.com\/api\/v1\/render?wait=60&quot; \\\n  -H &quot;Authorization: Bearer $JSONTOIMG_API_KEY&quot; \\\n  -H &quot;Content-Type: application\/json&quot; \\\n  -d &#39;{\n    &quot;template&quot;: &quot;tpl_graduation_award&quot;,\n    &quot;version&quot;: 1,\n    &quot;format&quot;: &quot;pdf&quot;,\n    &quot;layers&quot;: {\n      &quot;recipient_name&quot;: { &quot;text&quot;: &quot;Priya Sharma&quot; },\n      &quot;course_title&quot;: { &quot;text&quot;: &quot;Advanced Distributed Systems&quot; },\n      &quot;completion_date&quot;: { &quot;text&quot;: &quot;November 17, 2026&quot; },\n      &quot;certificate_id&quot;: { &quot;text&quot;: &quot;0190a7e2-5b1c-7c3e&quot; },\n      &quot;qr&quot;: { &quot;text&quot;: &quot;https:\/\/verify.example.com\/c\/0190a7e2-5b1c-7c3e&quot; }\n    }\n  }&#39;\n<\/code><\/pre>\n<p>The response returns a permanent asset URL for the rendered vector PDF. Each PDF page costs exactly 1 credit.<\/p>\n<h2>Step 3: Batch Rendering for Graduating Cohorts<\/h2>\n<p>For graduating cohorts of 100 to 1,000 students, use <code>POST \/api\/v1\/renders\/batch<\/code> to process jobs in batches of up to 50 certificates per request.<\/p>\n<p>Here is the complete production batch script in Python:<\/p>\n<pre><code class=\"language-python\">import os\nimport sqlite3\nimport requests\n\nAPI_KEY = os.environ.get(&quot;JSONTOIMG_API_KEY&quot;)\nTEMPLATE_ID = &quot;tpl_graduation_award&quot;\n\nconn = sqlite3.connect(&quot;lms.db&quot;)\ncursor = conn.cursor()\n\n# Query pending certificate awards\nrows = cursor.execute(&quot;&quot;&quot;\n    SELECT certificate_id, recipient_name, course_title, completion_date\n    FROM completions\n    WHERE certificate_generated = 0\n    LIMIT 50\n&quot;&quot;&quot;).fetchall()\n\njobs = [\n    {\n        &quot;id&quot;: f&quot;cert_{r[0]}&quot;,\n        &quot;template&quot;: TEMPLATE_ID,\n        &quot;version&quot;: 1,\n        &quot;format&quot;: &quot;pdf&quot;,\n        &quot;layers&quot;: {\n            &quot;certificate_id&quot;: {&quot;text&quot;: r[0]},\n            &quot;recipient_name&quot;: {&quot;text&quot;: r[1]},\n            &quot;course_title&quot;: {&quot;text&quot;: r[2]},\n            &quot;completion_date&quot;: {&quot;text&quot;: r[3]},\n            &quot;qr&quot;: {&quot;text&quot;: f&quot;https:\/\/verify.example.com\/c\/{r[0]}&quot;}\n        }\n    }\n    for r in rows\n]\n\nresponse = requests.post(\n    &quot;https:\/\/app.jsontoimg.com\/api\/v1\/renders\/batch&quot;,\n    json={&quot;jobs&quot;: jobs},\n    headers={&quot;Authorization&quot;: f&quot;Bearer {API_KEY}&quot;}\n)\n\nbatch = response.json()\nprint(f&quot;Batch {batch.get(&#39;id&#39;)} accepted with {batch.get(&#39;acceptedCount&#39;)} certificates queued.&quot;)\n<\/code><\/pre>\n<h2>Step 4: Making Certificates Verifiable<\/h2>\n<p>A certificate without verification is vulnerable to screenshot forgery. To ensure credibility:<\/p>\n<ol>\n<li><strong>Mint RFC 9562 UUIDs<\/strong>: Use UUID v4 or v7 rather than sequential IDs (<code>#41<\/code>, <code>#42<\/code>), which leak cohort volume and allow guessing adjacent URLs.<\/li>\n<li><strong>Vector QR Code Layer<\/strong>: jsontoimg generates native vector QR codes on the canvas, ensuring maximum scannability on both phone screens and printed paper.<\/li>\n<li><strong>Public Verification Page<\/strong>: Host a fast public route (e.g., <code>https:\/\/verify.example.com\/c\/&lt;uuid&gt;<\/code>) that looks up the UUID in your database and validates the recipient&#39;s name, issue date, and credential status.<\/li>\n<\/ol>\n<h2>Contrast &amp; Print Accessibility<\/h2>\n<p>Certificates are frequently printed and framed:<\/p>\n<ul>\n<li>Follow <a href=\"https:\/\/www.w3.org\/WAI\/WCAG21\/Understanding\/contrast-minimum.html\">WCAG 2.1 contrast minimums<\/a> (4.5:1 for body copy). Avoid light grey or subtle gold text against cream backgrounds.<\/li>\n<li>Enable auto-fitting on the <code>recipient_name<\/code> layer in J2I Studio so unusually long names automatically scale down rather than overflowing the certificate border.<\/li>\n<\/ul>\n<h2>Related Resources<\/h2>\n<ul>\n<li><a href=\"https:\/\/jsontoimg.com\/tools\/free-certificate-generator\">Free certificate generator<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/docs\/generate\/pdf\">PDF generation docs<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/use-cases\/event-tickets\">Event ticket generator API<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/use-cases\/certificates\">Certificate Generator API Hub<\/a> \u2014 Commercial overview and feature matrix.<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/certificate-generator-api-guide\">Batch Certificate Generation Guide<\/a> \u2014 Large cohort architecture and webhook patterns.<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/certificate-of-completion-template-fields\">Certificate of Completion: 6 Fields Worth Making Layers<\/a> \u2014 Design considerations for certificate templates.<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/product\/pdf-generation-api\">Programmatic PDF Generation API<\/a> \u2014 Per-page PDF generation docs.<\/li>\n<\/ul>\n<h2>Frequently Asked Questions<\/h2>\n<h3>Can I generate certificates as both PNG and PDF?<\/h3>\n<p>Yes. Requesting <code>&quot;format&quot;: &quot;pdf&quot;<\/code> outputs a vector-sharp printable document. Requesting <code>&quot;format&quot;: &quot;png&quot;<\/code> or <code>&quot;webp&quot;<\/code> outputs an image ideal for email attachments and LinkedIn sharing.<\/p>\n<h3>How does jsontoimg bill batch certificates?<\/h3>\n<p>Each rendered certificate or PDF page costs 1 credit. Failed renders never deduct credits. Prepaid credit packs ($5 for 250 certificates, $10 for 500) never expire.<\/p>\n<h3>Can I use n8n or Zapier to trigger certificates?<\/h3>\n<p>Yes. jsontoimg provides a native n8n community node (<code>@j2i\/n8n-nodes-j2i<\/code>) and standard REST endpoints that connect to Zapier, Make, and Airtable via HTTP.<\/p>\n<p><a href=\"https:\/\/app.jsontoimg.com\/login\">Get 25 free images \u2192<\/a><br \/>\n        &quot;template&quot;: &quot;certificate-award-v2&quot;,<br \/>\n        &quot;format&quot;: &quot;png&quot;,<br \/>\n        &quot;layers&quot;: {<br \/>\n          &quot;certificate_id&quot;: { &quot;text&quot;: &quot;CERT-2026-004218&quot; },<br \/>\n          &quot;recipient_name&quot;: { &quot;text&quot;: &quot;Arjun Mehta&quot; },<br \/>\n          &quot;course_title&quot;: { &quot;text&quot;: &quot;Advanced SQL for Data Analysts&quot; },<br \/>\n          &quot;completion_date&quot;: { &quot;text&quot;: &quot;2026-08-01&quot; }<br \/>\n        }<br \/>\n      }<br \/>\n    ]<br \/>\n  }&#39;<\/p>\n<pre><code>\nYour LMS or course platform already has this data \u2014 you\u2019re just exporting a few columns. Here\u2019s the whole pipeline in Python against a typical database:\n<\/code><\/pre>\n<p>import requests<br \/>\nimport sqlite3<\/p>\n<p>API_KEY = &quot;YOUR_API_KEY&quot;<br \/>\nTEMPLATE_ID = &quot;certificate-award-v2&quot;<\/p>\n<p>conn = sqlite3.connect(&quot;lms.db&quot;)<br \/>\nrows = conn.execute(&quot;&quot;&quot;<br \/>\n    SELECT certificate_id, recipient_name, course_title, completion_date<br \/>\n    FROM completions<br \/>\n    WHERE certificate_generated = 0<br \/>\n&quot;&quot;&quot;).fetchall()<\/p>\n<p>jobs = [{<br \/>\n    &quot;template&quot;: TEMPLATE_ID,<br \/>\n    &quot;format&quot;: &quot;png&quot;,<br \/>\n    &quot;layers&quot;: {<br \/>\n        &quot;certificate_id&quot;: { &quot;text&quot;: r[0] },<br \/>\n        &quot;recipient_name&quot;: { &quot;text&quot;: r[1] },<br \/>\n        &quot;course_title&quot;: { &quot;text&quot;: r[2] },<br \/>\n        &quot;completion_date&quot;: { &quot;text&quot;: r[3] },<br \/>\n    },<br \/>\n} for r in rows[:50]]<\/p>\n<p>resp = requests.post(<br \/>\n    &quot;<a href=\"https:\/\/app.jsontoimg.com\/api\/v1\/renders\/batch\">https:\/\/app.jsontoimg.com\/api\/v1\/renders\/batch<\/a>&quot;,<br \/>\n    json={&quot;jobs&quot;: jobs},<br \/>\n    headers={&quot;Authorization&quot;: f&quot;Bearer {API_KEY}&quot;},<br \/>\n)<br \/>\nbatch = resp.json()<br \/>\nprint(batch[&quot;id&quot;], batch.get(&quot;acceptedCount&quot;))<\/p>\n<pre><code>\nThat\u2019s the whole generator: select ungenerated completions \u2192 render \u2192 save. Run it after every cohort closes, or on a schedule.\n\n## Async Delivery with Webhooks\n\nFor very large batches \u2014 an event with 10,000 attendees, a certification body with quarterly exam cycles \u2014 synchronous rendering ties up your request for too long. Use async mode with a webhook instead:\n<\/code><\/pre>\n<p>curl -X POST <a href=\"https:\/\/app.jsontoimg.com\/api\/v1\/renders\/batch\">https:\/\/app.jsontoimg.com\/api\/v1\/renders\/batch<\/a> <br \/>  -H &quot;Authorization: Bearer $JSONTOIMG_API_KEY&quot; <br \/>  -H &quot;Content-Type: application\/json&quot; <br \/>  -d &#39;{<br \/>\n    &quot;jobs&quot;: [ \/* max 50; each job has template + layers; optional webhookUrl per job *\/ ]<br \/>\n  }&#39;<\/p>\n<h1>Then GET \/api\/v1\/renders\/batches\/{id}<\/h1>\n<pre><code>\njsontoimg calls your webhook when each batch finishes, and your app emails the certificate or updates the participant record. The typical flow:\n<\/code><\/pre>\n<p>Webhook trigger (course completion)<br \/>\n  \u2192 Look up participant row<br \/>\n  \u2192 Render certificate (sync for singles, batch for cohorts)<br \/>\n  \u2192 Upload to storage \/ attach to email<br \/>\n  \u2192 Mark certificate_generated = 1<\/p>\n<pre><code>\n## Verification: Unique IDs and QR Codes\n\nA certificate without verification is just a nice picture. Put the `certificate_id` on the certificate itself, and optionally a QR code that resolves to a public verification page:\n\n1.  Generate a unique ID per recipient in your database (`CERT-2026-004217`).\n2.  Pass it into the render as a dynamic layer \u2014 it appears on the certificate.\n3.  Publish a public endpoint: `https:\/\/verify.yoursite.com\/CERT-2026-004217` shows \u201cValid \u2014 issued to Priya Sharma for Advanced SQL for Data Analysts.\u201d\n4.  Render the same ID as a QR code layer so employers can scan and verify instantly.\n\nThis is the same pattern event platforms use for attendee badges and [event tickets](https:\/\/jsontoimg.com\/use-cases\/event-tickets\/): unique identifier in, tamper-evident image out.\n\nTwo of the choices above have published guidance behind them. For the identifier, [RFC 9562](https:\/\/datatracker.ietf.org\/doc\/html\/rfc9562) is the current UUID specification and the reason to mint a v4 or v7 UUID rather than an incrementing integer: a sequential certificate number tells a holder how many you have issued and lets anyone guess a neighbour&#39;s URL. For legibility, [WCAG 2.1&#39;s contrast minimum](https:\/\/www.w3.org\/WAI\/WCAG21\/Understanding\/contrast-minimum.html) applies to a certificate as much as to a web page, and a recipient name set in light grey on a cream background fails it on every copy. The format call is the last one \u2014 [MDN&#39;s image file type guide](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Media\/Guides\/Formats\/Image_types) covers PNG for the screen-shared version, while PDF is what survives being printed.\n\n## Real-World Numbers\n\nAn online learning platform with 5 concurrent courses, 100 graduates each per month:\n\n| Step | Manual | jsontoimg pipeline |\n| --- | --- | --- |\n| Design template | 1 designer, ~4 hours | 1 designer, ~4 hours (once) |\n| Generate 500 certificates | 80\u2013125 hours | ~2 minutes of API time |\n| Error rate | Typos happen per-certificate | Zero \u2014 data in, image out |\n| Delivery time | 3 days processing | Minutes after completion |\n| Verification | None or manual lookup | Built-in IDs + QR |\n\nThe template cost is paid once; the marginal cost of the 501st certificate is a single API call.\n\n## Key Takeaways\n\n-   Certificates are a data problem, not a design problem \u2014 one template plus JSON per recipient is the whole system.\n-   Batch rendering handles entire cohorts in one request; webhooks make it async for events at any scale.\n-   Unique IDs and QR codes turn generated certificates into verifiable credentials.\n-   The same pipeline pattern applies across use cases: product banners, OG images, tickets, welcome graphics.\n\n## FAQ\n\n### How do I generate hundreds of certificates at once?\n\nOne row per recipient, then `POST \/api\/v1\/renders\/batch` in chunks of 50. Five hundred certificates is ten sequential batch requests.\n\n### Can the certificates come out as PDF instead of PNG?\n\nYes. Send `format: &quot;pdf&quot;` and a multi-page template becomes a multi-page PDF, billed one credit per page \u2014 the same as a still.\n\n### How do I make a generated certificate verifiable?\n\nMint a unique ID per recipient, render it into the certificate as text, and point a QR image layer at a verification URL containing that ID. The image becomes a lookup key rather than a claim.\n\n### Do I need a webhook for a certificate run?\n\nFor a cohort of a few dozen, waiting on the batch response is fine. Past a few hundred, pass a webhook so the run does not hold a connection open while the queue drains.\n\n## Related Resources\n\n-   [Building a Certificate Generator with a Template-to-Image API](https:\/\/jsontoimg.com\/use-cases\/certificates\/) \u2014 the use case overview\n-   [Getting Started with jsontoimg: Your First API Call](https:\/\/jsontoimg.com\/blog\/getting-started-with-jsontoimg-first-api-call\/) \u2014 template basics before you build\n-   [Auto-Generate Open Graph Images for Your Blog](https:\/\/jsontoimg.com\/blog\/auto-generate-og-images-with-jsontoimg) \u2014 another data-to-image pipeline\n-   [Event Ticket Generation with jsontoimg](https:\/\/jsontoimg.com\/use-cases\/event-tickets\/) \u2014 unique-ID patterns for per-person assets\n-   [bulk certificate generation from a CSV](https:\/\/jsontoimg.com\/blog\/certificate-generator-api-guide)\n\nZoom out: [How JSON-to-Image Conversion Works](https:\/\/jsontoimg.com\/blog\/json-to-image-converter) maps the whole template, named-layer, and render-job architecture.\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Code for an API certificate generator: QR layer, PDF vs PNG, 50-job batches. Positioning page: \/use-cases\/certificates.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5,11,4,3],"class_list":["post-95","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-api","tag-automation","tag-image-generation","tag-jsontoimg"],"_links":{"self":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/95","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/comments?post=95"}],"version-history":[{"count":4,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/95\/revisions"}],"predecessor-version":[{"id":364,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/95\/revisions\/364"}],"wp:attachment":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/media?parent=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/categories?post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/tags?post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}