Create a QR Code

POST /api/v1/qr-code

Common errors include:

  • "Bad Request" if body parameters are not passed
  • "DNS_CONFIGURATION_ERROR" if custom domain DNS is misconfigured.

The createQrCodeHandler creates a qr code for the input body and returns the reponse to users

Request

Method : Post
Content-Type : Application/json

Request Body Schema

destinationUrl string Required
Default: -
Target URL for the QR code (required for website/barcode)
brandedDomain string Required
Default: -
Domain for the shortened URL
slashTag string Required
Default: -
Custom path for the shortened URL
qr object Required
Default: -
QR code configuration object
qrLogoId string No
Default: -
ID of the logo to be placed in QR code
frame object No
Default: -
Frame configuration for QR code
primary string
Default: -
Primary color for QR design
secondary string
Default: -
Secondary color for QR design
textColor string
Default: -
Color for text elements
text string
Default: -
Text to be encoded in QR (for text type)
qrType string
Default: website
Type of QR code (website, barcode, etc.)
password string
Default: -
Password for protecting the link
expirationDate string/date
Default: -
Expiration date for the link
title string
Default: Auto-fetched
Custom title for the link
tags string
Default: ''
Tags for organizing QR codes
preset string
Default: #000000
Preset color scheme
color string
Default: #000000
QR code color
bgColor string
Default: #ffffff
Background color
isBgTransparent boolean
Default: FALSE
Toggle background transparency
pattern string
Default: classy
QR code pattern style
corner string
Default: square
QR code corner style
fieldData object
Default: -
Additional data fields
LANGUAGE
REQUEST
 # cURL
  curl -X POST \
  'https://divsly-backend.vercel.app/api/v1/qr-code' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN_HERE' \
  -d '{
    "firstName":"",
    "lastName":"",
    "videos":[],
    "imageList":[],
    "bio":"doe",
    "mobile":"",
    "phone":"",
    "fax":"",
    "email":"",
    "qrType":"website",
    "company":"",
    "job":"",
    "address":"",
    "website":"",
    "summary":"",
    "businessType":"",
    "facebook":"",
    "instagram":"",
    "google":"",
    "linkedin":"",
    "welcomeImage":"",
    "profilePic":"",
    "title":"Preview",
    "qr":"//api.qrcode-monkey.com/tmp/807f36b526d53242cbdb35e73b0f363f.png",
    "qrLogoId":"886d912a169c986ca5f98c3450da9edaf3cdf137.png",
    "destinationUrl":"https://divsly.com",
    "slashTag":"dye6y",
    "brandedDomain":"kut.lt",
    "preset":"#000000",
    "color":"#000000",
    "bgColor":"#ffffff",
    "isBgTransparent":false,
    "pattern":"classy",
    "corner":"square",
    "logo":"",
    "edit":0,
    "frame":"",
    "gradientColor":"",
    "primaryColor":"#f1416c",
    "audioPrimary":"#000000",
    "primary":"",
    "secondary":"",
    "textColor":"",
    "text":"Scan Me",
    "about":"",
    "aboutName":"",
    "aboutPhone":"",
    "aboutEmail":"",
    "aboutWebsite":"",
    "mondayOpen":"monday",
    "tuesdayOpen":"tuesday",
    "wednesdayOpen":"wednesday",
    "thursdayOpen":"thursday",
    "fridayOpen":"friday",
    "saturdayOpen":"saturday",
    "sundayOpen":"sunday",
    "mondayStart":"09:00",
    "tuesdayStart":"09:00",
    "wednesdayStart":"09:00",
    "thursdayStart":"09:00",
    "fridayStart":"09:00",
    "saturdayStart":"09:00",
    "sundayStart":"09:00",
    "mondayEnd":"20:00",
    "tuesdayEnd":"20:00",
    "wednesdayEnd":"20:00",
    "thursdayEnd":"20:00",
    "fridayEnd":"20:00",
    "saturdayEnd":"20:00",
    "sundayEnd":"20:00",
    "ctaColor":"#e9e7e7",
    "buttonText":"View",
    "buttonLink":"https://www.divsly.com",
    "audioTitle":"",
    "bannerImage":"",
    "pdfPassword":"",
    "password":"",
    "passwordProtectionEnabled":false,
    "fieldData":"{\"destinationUrl\":\"https://divsly.com\",\"title\":\"Preview\",\"metaDescription\":\"\",\"brandedDomain\":\"kut.lt\",\"contentWelcomeImage\":\"\",\"contentWelcomeTime\":2.5,\"password\":\"\",\"passwordProtectionEnabled\":false}",
    "expirationDate":"2025-06-25T06:21:29.854Z"
  }'

API REQUEST
 // JavaScript Fetch
  const payload = {
  firstName: "",
  lastName: "",
  videos: [],
  imageList: [],
  bio: "doe",
  mobile: "",
  phone: "",
  fax: "",
  email: "",
  qrType: "website",
  company: "",
  job: "",
  address: "",
  website: "",
  summary: "",
  businessType: "",
  facebook: "",
  instagram: "",
  google: "",
  linkedin: "",
  welcomeImage: "",
  profilePic: "",
  title: "Preview",
  qr: "//api.qrcode-monkey.com/tmp/807f36b526d53242cbdb35e73b0f363f.png",
  qrLogoId: "886d912a169c986ca5f98c3450da9edaf3cdf137.png",
  destinationUrl: "https://divsly.com",
  slashTag: "dye6y",
  brandedDomain: "kut.lt",
  preset: "#000000",
  color: "#000000",
  bgColor: "#ffffff",
  isBgTransparent: false,
  pattern: "classy",
  corner: "square",
  logo: "",
  edit: 0,
  frame: "",
  gradientColor: "",
  primaryColor: "#f1416c",
  audioPrimary: "#000000",
  primary: "",
  secondary: "",
  textColor: "",
  text: "Scan Me",
  // ... rest of your payload
  fieldData: "{\"destinationUrl\":\"https://divsly.com\",\"title\":\"Preview\",\"metaDescription\":\"\",\"brandedDomain\":\"kut.lt\",\"contentWelcomeImage\":\"\",\"contentWelcomeTime\":2.5,\"password\":\"\",\"passwordProtectionEnabled\":false}",
  expirationDate: "2025-06-25T06:21:29.854Z"
};

fetch('https://divsly-backend.vercel.app/api/v1/qr-code', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_TOKEN_HERE'
  },
  body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

API REQUEST
  // Axios (Node.js)
  const axios = require('axios');

 const payload = {
  firstName: "",
  lastName: "",
  videos: [],
  imageList: [],
  bio: "doe",
  // ... rest of your payload as above
 };

  axios.post('https://divsly-backend.vercel.app/api/v1/qr-code', payload, {
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_TOKEN_HERE'
  }
 })
 .then(response => console.log(response.data))
 .catch(error => console.error('Error:', error));

API REQUEST
 // PHP
 $payload = array(
    'firstName' => '',
    'lastName' => '',
    'videos' => array(),
    'imageList' => array(),
    'bio' => 'doe',
    // ... rest of your payload
 );

  $ch = curl_init('https://divsly-backend.vercel.app/api/v1/qr-code');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Authorization: Bearer YOUR_TOKEN_HERE'
  ));

 $response = curl_exec($ch);
 $result = json_decode($response, true);

 curl_close($ch);
 print_r($result);
 
API REQUEST
  # Python (requests)
  import requests
 import json

 payload = {
    "firstName": "",
    "lastName": "",
    "videos": [],
    "imageList": [],
    "bio": "doe",
    # ... rest of your payload
 }

 headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_TOKEN_HERE'
 }

  response = requests.post(
    'https://divsly-backend.vercel.app/api/v1/qr-code',
    headers=headers,
    json=payload
  )

 print(response.json())

RESPONSE
  {
  "message": "QR Code Created Successfully.",
  "data": {
    "id": 1167,
    "type": "qr",
    "type2": null,
    "userId": 92,
    "clicks": 0,
    "lbClicks": 0,
    "scans": 0,
    "destinationUrl": "https://divsly.com",
    "faviconUrl": "assets/img/logo/favicon.png",
    "title": "Preview",
    "titleLabel": "preview",
    "btnLabel": null,
    "brandedDomain": "kut.lt",
    "slashTag": "dye6y",
    "edit": 0,
    "utm_id": null,
    "utm_content": null,
    "utm_term": null,
    "utm_campaign": null,
    "utm_medium": null,
    "utm_source": null,
    "preset": "#000000",
    "bgColor": "#ffffff",
    "color": "#000000",
    "pattern": "classy",
    "corner": "square",
    "logo": "886d912a169c986ca5f98c3450da9edaf3cdf137.png",
    "qr": "//api.qrcode-monkey.com/tmp/807f36b526d53242cbdb35e73b0f363f.png",
    "qrLogoId": "886d912a169c986ca5f98c3450da9edaf3cdf137.png",
    "tags": "",
    "linkInBioId": null,
    "uniqueTagId": 1228,
    "isActive": true,
    "isStarred": false,
    "expirationDate": "2025-06-25T06:21:29.854Z",
    "createdAt": "2025-03-27T06:21:38.331Z",
    "updatedAt": "2025-03-27T06:21:38.331Z",
    "fieldData": "{\"destinationUrl\":\"https://divsly.com\",\"title\":\"Preview\",\"metaDescription\":\"\",\"brandedDomain\":\"kut.lt\",\"contentWelcomeImage\":\"\",\"contentWelcomeTime\":2.5,\"password\":\"\",\"passwordProtectionEnabled\":false}",
    "frame": "",
    "isadminblocked": false,
    "isEdit": false,
    "password": null,
    "passwordProtectionEnabled": false,
    "primary": "",
    "qrType": "website",
    "secondary": "",
    "text": "Scan Me",
    "textColor": ""
  }
}
     
  {
  "success": false,
  "message": “Failed to create QR code”
}


  {
            error: true,
            data: {
                message: 'Qr Code Color Options Exceeded for your current plan. Please upgrade!',
            },
}

    
  {
            error: true,
            data: {
                message: 'Qr Code Color Options Exceeded for your current plan. Please upgrade!',
            },
}


    
  {
            error: true,
            data: {
                message: 'Qr Code Color Options Exceeded for your current plan. Please upgrade!',
            },
}

    
  {
   success: false,
   message: 'This exact link already exists and cannot be duplicated',
}
    
  {
            error: true,
            data: {
                message: 'Link Limit Exceeded for your current plan. Please upgrade!',
            },
}

    

    { success: false, message: “string contains error description” }
    
  {
            error: true,
            data: {
                message: 'Qr Code Limit Exceeded for your current plan. Please upgrade!',
            },
}