Paste QR API v1
Build products on Paste QR: create codes and landing pages, read scans, issue one-time links and get signed webhooks on every scan. Available on Pro. Spec: openapi.json.
Auth
Create a key in the dashboard (shown once). Send Authorization: Bearer sqr_…. Limit: 60 requests/minute per key (see X-RateLimit-* headers; 429 with Retry-After).
Errors are always {"error":{"code":"…","message":"…"}} with codes such as unauthorized, plan_required, rate_limited, not_found, invalid_data, plan_limit.
Endpoints
- GET · POST
/codes - GET · PATCH · DELETE
/codes/:id - GET
/codes/:id/stats?format=csv - GET
/codes/:id/image?format=png|svg&size=1024 - POST
/codes/:id/tokensone-time links - GET · PUT · DELETE
/codes/:id/webhook - GET
/templatesno key
curl -X POST https://pasteqr.com/api/v1/codes \
-H "Authorization: Bearer $SQR_KEY" -H "Content-Type: application/json" \
-d '{"type":"page","template":"menu","title":"Cafe","data":{"business":"Cafe Swanky","items":[{"name":"Masala chai","price":"₹40"}]}}'Types: url {payload:{url}}, whatsapp, upi, app {routing:{ios,android,web}}, page {template,data}. Optional settings: ends_at, max_scans (1 = one-time), require_token.
Scan webhooks (IoT / access)
Each scan POSTs JSON {id,type:"scan",created,data:{code_id,slug,country,device,os,token_used}} with headers X-SwankyQR-Timestamp and X-SwankyQR-Signature: v1=hex(HMAC_SHA256(secret, timestamp + "." + rawBody)). Reject if the timestamp is older than 5 minutes, and ignore repeated ids.
const ok = crypto.timingSafeEqual(
Buffer.from(sig.replace("v1=", "")),
Buffer.from(crypto.createHmac("sha256", secret).update(ts + "." + raw).digest("hex")))
&& Math.abs(Date.now()/1000 - Number(ts)) < 300;Templates (28)
menu— Restaurant menu (Food & retail)payment— UPI payment page (Payments)reviews— Review us (Marketing)coupon— Coupon / offer (Marketing)loyalty— Loyalty card (Marketing)business_card— Digital business card (People)links— Link in bio / links list (People)property— Property listing (Listings)vehicle— Car / vehicle for sale (Listings)event— Event (Events)ticket— Ticket / check-in pass (Events)access— Access / IoT trigger (Access & IoT)asset— Asset / inventory tag (Operations)maintenance— Maintenance / service request (Operations)authenticity— Product authenticity & warranty (Products)emergency_id— Emergency contact ID (info only) (Health (info only))clinic— Clinic / pharmacy info (Health (info only))public_notice— Public / government info notice (Government (info only))attendance— Class attendance (Education)certificate— Certificate verification (Education)pet_tag— Pet tag (Lost & found)lost_found— Luggage / lost & found tag (Lost & found)visitor— Visitor sign-in (Operations)guide— Museum / audio guide (Culture & tourism)traceability— Traceability (farm-to-fork / supply chain) (Products)feedback— Feedback form (Marketing)app_download— App download (smart link) (Marketing)brochure— PDF / brochure (Documents)