Create qr code

POST /qr-code

Body Required

  • text string Required

    The text that will be encoded in the QR code

  • size integer

    the output pixel of the image generated

    Minimum value is 50, maximum value is 2000. Default value is 300.

  • file_type string Required

    The output file format of the generated QR code. Accepted values svg or png.

    Values are svg or png.

  • The style of the top-left eye frame of the generated QR code. please refer to our documentation for available style options

    Hide eye_frame_1 attributes Show eye_frame_1 attributes object
    • style string

      style code

      Default value is 1.

    • rotate integer

      The degree of clockwise rotation for the style of the top-left eye frame of the generated QR code. Accepted values 0, 90, 180, 270.

      Values are 0, 90, 180, or 270. Default value is 0.

    • color string

      The color of the style of the top-left eye frame of the generated QR code, in hexadecimal format, eg '#RRGGBB'

      Default value is #000000.

  • The style of the top-right eye frame of the generated QR code. please refer to our documentation for available style options

    Hide eye_frame_2 attributes Show eye_frame_2 attributes object
    • style string

      style code

      Default value is 1.

    • rotate integer

      Values are 0, 90, 180, or 270. Default value is 0.

    • color string

      Default value is #000000.

  • The style of the bottom-left eye frame of the generated QR code. please refer to our documentation for available style options

    Hide eye_frame_3 attributes Show eye_frame_3 attributes object
    • style string

      style code

      Default value is 1.

    • rotate integer

      Values are 0, 90, 180, or 270. Default value is 0.

    • color string

      Default value is #000000.

  • The style of the top-left eye ball of the generated QR code. please refer to our documentation for available style options

    Hide eye_ball_1 attributes Show eye_ball_1 attributes object
    • style string

      style code

      Default value is 1.

    • rotate integer

      Values are 0, 90, 180, or 270. Default value is 0.

    • color string

      Default value is #000000.

  • The style of the top-right eye ball of the generated QR code. please refer to our documentation for available style options

    Hide eye_ball_2 attributes Show eye_ball_2 attributes object
    • style string

      style code

      Default value is 1.

    • rotate integer

      Values are 0, 90, 180, or 270. Default value is 0.

    • color string

      Default value is #000000.

  • The style of the bottom-left eye ball of the generated QR code. please refer to our documentation for available style options

    Hide eye_ball_3 attributes Show eye_ball_3 attributes object
    • style string

      style code

      Default value is 1.

    • rotate integer

      Values are 0, 90, 180, or 270. Default value is 0.

    • color string

      Default value is #000000.

  • body object

    The style of the body

    Hide body attributes Show body attributes object
    • style string

      style code

      Default value is 1.

    • color string

      Default value is #000000.

    • gradient object

      The gradient that fills the body of the generated QR code, it will override the 'color' property

      Hide gradient attributes Show gradient attributes object
      • The type of gradient, specified as either 'linear' or 'radial'.

        Values are linear or radial. Default value is linear.

      • Specifies whether the gradient fills the entire QR code, including the eye frames and eye balls

        Default value is false.

      • specifies the direction of the linear gradient, equivalent to the properties in an SVG linear gradient, For more information on SVG linear gradients, see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient

        Default value is 0, 0, 1, 0.

        Hide linear_direction attributes Show linear_direction attributes object
        • x1 number

          The percentage value of the x-axis coordinate where the gradient begins, as a decimal value between 0.0 and 1

        • y1 number

          The percentage value of the y-axis coordinate where the gradient begins, as a decimal value between 0.0 and 1

        • x2 number

          The percentage value of the x-axis coordinate where the gradient ends, as a decimal value between 0.0 and 1

        • y2 number

          The percentage value of the y-axis coordinate where the gradient ends, as a decimal value between 0.0 and 1

      • An array containing objects that define the color stops and colors

        Default value is no default.

  • image object

    defines the image to be placed

    Hide image attributes Show image attributes object
    • image_id string

      A string value that specifies the ID of a user-uploaded image, which can be obtained from a previous upload image response

    • specifies the percentage of the QR code’s size that is occupied by the image. The value must be a decimal number between 0.0 and 1.0 (exclusive), where 0.0 means no image and 1.0 means the image covers the entire QR code. Note that a large image_size may make the QR code unreadable by some devices.

      Default value is 0.3.

    • determines whether the background behind the integrated logo is removed or not. The value can be either “clean” or “default”. If the value is “clean”, the background behind the logo is removed

      Default value is default.

  • sets the background of the QR code

    Hide background attribute Show background attribute object
    • color string

      The color of the background, in hexadecimal format, eg '#RRGGBB'

      Default value is #ffffff.

Responses

POST /qr-code
curl \
 -X POST http://petstore.swagger.io/v2/qr-code \
 -H "Content-Type: application/json" \
 -d '{"text":"https://www.example.com","size":300,"file_type":"svg","eye_frame_1":{"style":"1","rotate":0,"color":"#000000"},"eye_frame_2":{"style":"1","rotate":0,"color":"#000000"},"eye_frame_3":{"style":"1","rotate":0,"color":"#000000"},"eye_ball_1":{"style":"1","rotate":0,"color":"#000000"},"eye_ball_2":{"style":"1","rotate":0,"color":"#000000"},"eye_ball_3":{"style":"1","rotate":0,"color":"#000000"},"body":{"style":"1","color":"#000000","gradient":{"gradient_type":"linear","gradient_on_eyes":false,"linear_direction":{"x1":0.0,"y1":0.0,"x2":42.0,"y2":42.0},"gradient_colors":["no default"]}},"image":{"image_id":"tobdd6to4450d5f18b00.png","image_size":0.3,"image_mode":"clean"},"background":{"color":"#ffffff"}}'
Request example
{
  "text": "https://www.example.com",
  "size": 300,
  "file_type": "svg",
  "eye_frame_1": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "eye_frame_2": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "eye_frame_3": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "eye_ball_1": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "eye_ball_2": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "eye_ball_3": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "body": {
    "style": "1",
    "color": "#000000",
    "gradient": {
      "gradient_type": "linear",
      "gradient_on_eyes": false,
      "linear_direction": {
        "x1": 0.0,
        "y1": 0.0,
        "x2": 42.0,
        "y2": 42.0
      },
      "gradient_colors": [
        "no default"
      ]
    }
  },
  "image": {
    "image_id": "tobdd6to4450d5f18b00.png",
    "image_size": 0.3,
    "image_mode": "clean"
  },
  "background": {
    "color": "#ffffff"
  }
}
Request examples
{
  "text": "https://www.example.com",
  "size": 300,
  "file_type": "svg",
  "eye_frame_1": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "eye_frame_2": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "eye_frame_3": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "eye_ball_1": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "eye_ball_2": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "eye_ball_3": {
    "style": "1",
    "rotate": 0,
    "color": "#000000"
  },
  "body": {
    "style": "1",
    "color": "#000000",
    "gradient": {
      "gradient_type": "linear",
      "gradient_on_eyes": false,
      "linear_direction": {
        "x1": 0.0,
        "y1": 0.0,
        "x2": 42.0,
        "y2": 42.0
      },
      "gradient_colors": [
        "no default"
      ]
    }
  },
  "image": {
    "image_id": "tobdd6to4450d5f18b00.png",
    "image_size": 0.3,
    "image_mode": "clean"
  },
  "background": {
    "color": "#ffffff"
  }
}