{"openapi":"3.1.0","info":{"title":"Scan Code Pro API v1","version":"1.0.0","description":"Paid API generation for active Business and Enterprise accounts. Business: 1000 admitted requests per UTC calendar month, shared across all account keys. Enterprise: no monthly cap. Every admitted request counts before validation, including invalid input and later generation errors. Separate 60 requests/minute per-IP abuse buckets are per instance; AI GET/POST share a bucket. All responses are private/no-store.","contact":{"name":"Scan Code Pro","url":"https://www.scancodepro.com"}},"servers":[{"url":"https://api.scancodepro.com"}],"paths":{"/api/ai/qr":{"post":{"tags":["Code Generation"],"summary":"Generate QR code (JSON)","description":"Generate a QR code for an HTTP(S) URL or WiFi network. PNG returns a data URL; SVG returns XML. PDF is unsupported. Size and margin must be integer JSON numbers; hidden must be a JSON boolean.","operationId":"generateQRCode","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QRCodeRequest"}}}},"responses":{"200":{"description":"QR code generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QRCodeResponse"}}},"headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Used":{"$ref":"#/components/headers/X-RateLimit-Used"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Used":{"$ref":"#/components/headers/X-RateLimit-Used"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/SubscriptionRequired"},"429":{"$ref":"#/components/responses/JsonRateLimited"},"503":{"$ref":"#/components/responses/AuthorizationUnavailable"}}},"get":{"tags":["Code Generation"],"summary":"Generate QR code (GET, JSON)","description":"Generate QR output as JSON using query parameters. Prefer POST for WiFi credentials and sensitive payloads.","operationId":"generateQRCodeGet","parameters":[{"name":"type","in":"query","required":true,"description":"Type of QR code to generate","schema":{"type":"string","enum":["url","wifi"]},"example":"url"},{"name":"url","in":"query","required":false,"description":"Absolute HTTP or HTTPS URL, required for type=url.","schema":{"type":"string","format":"uri"},"example":"https://www.scancodepro.com"},{"name":"ssid","in":"query","required":false,"description":"WiFi network name (required when type=wifi)","schema":{"type":"string"},"example":"MyHomeWiFi"},{"name":"password","in":"query","required":false,"description":"Required nonblank password for WPA/WEP; optional and ignored for nopass. Prefer POST to keep credentials out of URLs.","schema":{"type":"string"},"example":"supersecret123"},{"name":"security","in":"query","required":false,"description":"WiFi security type","schema":{"type":"string","enum":["WPA","WEP","nopass"],"default":"WPA"},"example":"WPA"},{"name":"hidden","in":"query","required":false,"description":"Literal true or false; other query values are rejected.","schema":{"type":"boolean","default":false},"example":false},{"name":"size","in":"query","required":false,"description":"QR code size in pixels","schema":{"type":"integer","minimum":64,"maximum":2048,"default":256},"example":256},{"name":"format","in":"query","required":false,"description":"Output format","schema":{"type":"string","enum":["png","svg"],"default":"png"},"example":"png"},{"name":"margin","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":64,"default":2}},{"name":"fg","in":"query","required":false,"schema":{"type":"string","pattern":"^#?(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$","default":"000000"}},{"name":"bg","in":"query","required":false,"schema":{"type":"string","pattern":"^#?(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$","default":"FFFFFF"}},{"name":"ec","in":"query","required":false,"schema":{"type":"string","enum":["L","M","Q","H"],"default":"M"}}],"responses":{"200":{"description":"QR code generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QRCodeResponse"}}},"headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Used":{"$ref":"#/components/headers/X-RateLimit-Used"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Used":{"$ref":"#/components/headers/X-RateLimit-Used"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/SubscriptionRequired"},"429":{"$ref":"#/components/responses/JsonRateLimited"},"503":{"$ref":"#/components/responses/AuthorizationUnavailable"}}}},"/api/v1/code":{"get":{"tags":["Code Generation"],"summary":"Generate a barcode/QR as an image","description":"Authenticated image download. QR supports PNG/SVG; all other types support PNG only. Data is encoded without creating a saved code or analytics record. Fetch from your server with an Authorization header; direct img URLs cannot supply the key.","operationId":"getCodeImage","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["qr","code128","ean13","upca","datamatrix","pdf417","aztec"],"default":"qr"},"example":"qr","description":"Code symbology"},{"name":"data","in":"query","required":true,"schema":{"type":"string"},"description":"Data to encode (text/URL or numeric per standard)","example":"https://scancodepro.com"},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["png","svg"],"default":"png"},"example":"png","description":"Output format. SVG currently supported for type=qr."},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":64,"maximum":2048,"default":256},"example":256,"description":"Image size (QR width or scale-derived for barcodes)."},{"name":"margin","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":64,"default":4},"example":4,"description":"Integer quiet zone: QR modules or barcode padding before scaling. Range 0–64."},{"name":"fg","in":"query","required":false,"schema":{"type":"string","pattern":"^#?(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$","default":"000000"},"example":"000000","description":"Foreground color hex (no alpha)."},{"name":"bg","in":"query","required":false,"schema":{"type":"string","pattern":"^#?(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$","default":"FFFFFF"},"example":"FFFFFF","description":"Background color hex (no alpha)."},{"name":"ec","in":"query","required":false,"schema":{"type":"string","enum":["L","M","Q","H"],"default":"M"},"example":"Q","description":"Error correction L/M/Q/H; accepted only for QR output."},{"name":"label","in":"query","required":false,"schema":{"type":"string"},"description":"Nonblank replacement display text for code128, ean13, or upca only; rejected for other types."},{"name":"labelPos","in":"query","required":false,"schema":{"type":"string","enum":["top","bottom","none"],"default":"bottom"},"description":"1D barcode label position. none suppresses the label and cannot be combined with label."}],"responses":{"200":{"description":"Image bytes","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/svg+xml":{"schema":{"type":"string"}}},"headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Used":{"$ref":"#/components/headers/X-RateLimit-Used"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"400":{"description":"Invalid parameters or generation failure.","headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Used":{"$ref":"#/components/headers/X-RateLimit-Used"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/SubscriptionRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/AuthorizationUnavailable"}}}},"/api/v1/wifi":{"get":{"tags":["Code Generation"],"summary":"Generate a WiFi QR as an image","description":"Authenticated WiFi QR image download, PNG or SVG. Prefer POST /api/ai/qr for WiFi credentials to avoid placing them in URLs.","operationId":"getWifiQR","parameters":[{"name":"ssid","in":"query","required":true,"schema":{"type":"string"},"description":"WiFi network name (SSID)"},{"name":"password","in":"query","required":false,"schema":{"type":"string"},"description":"Required nonblank password for WPA/WEP; optional and ignored for nopass. Prefer POST to keep credentials out of URLs."},{"name":"security","in":"query","required":false,"schema":{"type":"string","enum":["WPA","WEP","nopass"],"default":"WPA"},"example":"WPA","description":"Security type. Use nopass for open networks."},{"name":"hidden","in":"query","required":false,"schema":{"type":"boolean","default":false},"example":false,"description":"Literal true or false; other query values are rejected."},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["png","svg"],"default":"png"},"example":"png","description":"Output format"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":64,"maximum":2048,"default":256},"example":256,"description":"Image size in pixels"},{"name":"margin","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":64,"default":4},"example":4,"description":"Integer quiet zone: QR modules or barcode padding before scaling. Range 0–64."},{"name":"fg","in":"query","required":false,"schema":{"type":"string","pattern":"^#?(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$","default":"000000"},"example":"000000","description":"Foreground color hex"},{"name":"bg","in":"query","required":false,"schema":{"type":"string","pattern":"^#?(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$","default":"FFFFFF"},"example":"FFFFFF","description":"Background color hex"},{"name":"ec","in":"query","required":false,"schema":{"type":"string","enum":["L","M","Q","H"],"default":"M"},"example":"M","description":"Error correction L/M/Q/H; accepted only for QR output."}],"responses":{"200":{"description":"Image bytes","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/svg+xml":{"schema":{"type":"string"}}},"headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Used":{"$ref":"#/components/headers/X-RateLimit-Used"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"400":{"description":"Invalid parameters or generation failure.","headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Used":{"$ref":"#/components/headers/X-RateLimit-Used"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/SubscriptionRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/AuthorizationUnavailable"}}}}},"components":{"schemas":{"QRCodeRequest":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["url","wifi"],"description":"Type of QR code to generate","example":"url"},"url":{"type":"string","format":"uri","description":"Absolute HTTP or HTTPS URL, required for type=url.","example":"https://www.scancodepro.com"},"ssid":{"type":"string","description":"WiFi network name (required when type=wifi)","example":"MyHomeWiFi"},"password":{"type":"string","description":"Required nonblank password for WPA/WEP; optional and ignored for nopass.","example":"supersecret123"},"security":{"type":"string","enum":["WPA","WEP","nopass"],"default":"WPA","description":"WiFi security type","example":"WPA"},"hidden":{"type":"boolean","default":false,"description":"JSON boolean; string values are rejected. Default false.","example":false},"size":{"type":"integer","minimum":64,"maximum":2048,"default":256,"description":"QR code size in pixels","example":256},"format":{"type":"string","enum":["png","svg"],"default":"png","description":"Output format (png returns base64 data URL, svg returns SVG string)","example":"png"},"margin":{"type":"integer","minimum":0,"maximum":64,"default":2},"fg":{"type":"string","pattern":"^#?(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$","default":"000000"},"bg":{"type":"string","pattern":"^#?(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$","default":"FFFFFF"},"ec":{"type":"string","enum":["L","M","Q","H"],"default":"M"}}},"QRCodeResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the request was successful","example":true,"const":true},"data":{"type":"string","description":"Generated QR code data: base64 data URL for PNG or SVG XML string for SVG.","example":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."},"metadata":{"type":"object","description":"Metadata about the generated QR code","properties":{"type":{"type":"string","description":"Type of QR code that was generated","example":"url"},"format":{"type":"string","description":"Format of the generated QR code","example":"png"},"size":{"type":"integer","description":"Size of the generated QR code in pixels","example":256}}}},"required":["success","data","metadata"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Always false for error responses","example":false,"const":false},"error":{"type":"string","description":"Error message describing what went wrong","example":"URL is required for url type"}},"required":["success","error"]}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Server-side API key issued from the dashboard. Requires active Business or Enterprise subscription. Never place keys in URLs or browser code."}},"headers":{"Cache-Control":{"description":"Sensitive output and errors are private and must not be cached.","schema":{"type":"string","const":"private, no-store"}},"X-RateLimit-Limit":{"description":"Monthly account quota after paid authorization.","schema":{"type":"string","enum":["1000","unlimited"]}},"X-RateLimit-Used":{"description":"Admitted requests this UTC calendar month across all account keys.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Business requests remaining; omitted for Enterprise.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Next UTC calendar-month boundary.","schema":{"type":"string","format":"date-time"}}},"responses":{"Unauthorized":{"description":"Missing, invalid, or revoked API key.","headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer authentication challenge."}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"SubscriptionRequired":{"description":"An active Business or Enterprise subscription is required.","headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"RateLimited":{"description":"Monthly account quota exhausted or per-instance IP abuse limit reached. Monthly quota headers describe account usage, even for an instance limiter denial.","headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Used":{"$ref":"#/components/headers/X-RateLimit-Used"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Retry-After":{"description":"Seconds until retry is allowed.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"success":{"type":"boolean","const":false}}}},"text/plain":{"schema":{"type":"string"}}}},"AuthorizationUnavailable":{"description":"Authorization infrastructure unavailable; no anonymous fallback.","headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"JsonRateLimited":{"description":"Monthly account quota exhausted or per-instance IP abuse limit reached. Monthly quota headers describe account usage, even for an instance limiter denial.","headers":{"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Used":{"$ref":"#/components/headers/X-RateLimit-Used"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Retry-After":{"description":"Seconds until retry is allowed.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"success":{"type":"boolean","const":false}}}}}}}},"security":[{"bearerAuth":[]}]}