Skip to main content

Generate a QR code.

POST 

/generate/qrcode/encode

Returns a QR code as a PNG image, styled using the provided settings.

Request

Header Parameters

    ipaas string

Bodyrequired

    datastringrequired

    The data that should be encoded

    Example: https://wemakefuture.com
    widthnumber

    The width of the QR code in pixels. Default is 500.

    Example: 500
    heightnumber

    The height of the QR code in pixels. Default is 500.

    Example: 500
    imagestring

    The URL of the image that should be put in the middle. By default, no image is used. The image covers up part of the QR code, which can only be recovered using error correction.

    Example: https://pbs.twimg.com/profile_images/1325818753842618384/I9aD7jAt_400x400.jpg
    marginnumber

    The size of the space between the QR code and the border of the image in pixels. Default is 15.

    Example: 15
    qrOptions object

    Options for the QR code data.

    typeNumbernumber

    The type of the QR code. This must be an integer between 1 and 40. The number of dots on each side of the QR code is 4 * type number + 17. If the type is too low to encode all data, the request will fail. By default, the QR code is sized as small as possible.

    Example: 5
    modestring

    The mode of the QR code. This decides which characters are allowed in the QR code:

    • Numeric: Only numbers from 0 to 9.
    • Alphanumeric: Numbers from 0 to 9, latin letters from A to Z (only upper-case), spaces, and the following special characters: $, %, *, +, -, ., /, :.
    • Byte: Any bytes.

    For almost all cases, Byte is the correct choice, including for URLs. Default is Byte.

    Possible values: [Numeric, Alphanumeric, Byte]

    Example: Byte
    errorCorrectionLevelstring

    The error correction level. The higher the level is, the more likely it becomes the QR code can still be read in bad conditions, e.g. bad lighting, shaking, or when part of the code is hidden or destroyed. However, error correction also requires more data to be stored in the QR code, meaning the typeNumber will be higher. These are the approximate percentages of data that can be restored with the respective error correction levels:

    • L: 7%
    • M: 15%
    • Q: 25%
    • H: 30%

    Default is Q.

    Possible values: [L, M, Q, H]

    Example: Q
    imageOptions object

    Options for the image in the center of the QR code.

    hideBackgroundDotsboolean

    Whether the dots covered by the image should be hidden. Default is true.

    Example: true
    marginnumber

    The size of the empty space around the image in pixels. Increasing the margin will decrease the image size. Default is 0.

    Example: 0
    dotsOptions object

    Options for the dots that make up most of the QR code.

    typestring

    The style of the dots. Default is square.

    Possible values: [dots, rounded, classy, classy-rounded, square, extra-rounded]

    Example: square
    colorstring

    The color of the dots as a hexcode. Can only be used if gradient is not used. Default is #000000, i.e. black.

    Possible values: Value must match regular expression #[A-Fa-f0-9]{6}

    Example: #000000
    gradient object

    Options for a color gradient of the dots. Can only be used if color is not used.

    typestringrequired

    The type of gradient. This can be one of two options:

    • radial: The gradient starts at the center of the image and moves outwards.
    • linear: The gradient starts at one side and moves to the other.

    Possible values: [radial, linear]

    Example: linear
    rotationnumber

    The clockwise rotation of the gradient in degrees. Can only be used when type is linear. Default is no rotation.

    colorStops object[]required

    The color stops in the gradient.

  • Array [
  • offsetnumberrequired

    The offset where this color should be used. Must be between 0 and 1.

    Example: 0
    colorstringrequired

    The color of this color stop as a hexcode.

    Possible values: Value must match regular expression #[A-Fa-f0-9]{6}

    Example: #FF0000
  • ]
  • cornersSquareOptions object

    Options for the corner squares. This does not influence the smaller dots inside the corner squares.

    typestring

    The style of the corner squares. Default is square.

    Possible values: [square, extra-rounded, dot]

    Example: square
    colorstring

    The color of the corner squares as a hexcode. Can only be used if gradient is not used. Default is #000000, i.e. black.

    Possible values: Value must match regular expression #[A-Fa-f0-9]{6}

    Example: #000000
    gradient object

    Options for a color gradient of the corner squares. Can only be used if color is not used.

    typestringrequired

    The type of gradient. This can be one of two options:

    • radial: The gradient starts at the center of the image and moves outwards.
    • linear: The gradient starts at one side and moves to the other.

    Possible values: [radial, linear]

    Example: linear
    rotationnumber

    The clockwise rotation of the gradient in degrees. Can only be used when type is linear. Default is no rotation.

    colorStops object[]required

    The color stops in the gradient.

  • Array [
  • offsetnumberrequired

    The offset where this color should be used. Must be between 0 and 1.

    Example: 0
    colorstringrequired

    The color of this color stop as a hexcode.

    Possible values: Value must match regular expression #[A-Fa-f0-9]{6}

    Example: #FF0000
  • ]
  • cornersDotOptions object

    Options for the corner dots. This does not influence the square border around the corner dots.

    typestring

    The style of the corner dots. Default is square.

    Possible values: [square, dot]

    Example: square
    colorstring

    The color of the corner dots as a hexcode. Can only be used if gradient is not used. Default is #000000, i.e. black.

    Possible values: Value must match regular expression #[A-Fa-f0-9]{6}

    Example: #000000
    gradient object

    Options for a color gradient of the corner squares. Can only be used if color is not used.

    typestringrequired

    The type of gradient. This can be one of two options:

    • radial: The gradient starts at the center of the image and moves outwards.
    • linear: The gradient starts at one side and moves to the other.

    Possible values: [radial, linear]

    Example: linear
    rotationnumber

    The clockwise rotation of the gradient in degrees. Can only be used when type is linear. Default is no rotation.

    colorStops object[]required

    The color stops in the gradient.

  • Array [
  • offsetnumberrequired

    The offset where this color should be used. Must be between 0 and 1.

    Example: 0
    colorstringrequired

    The color of this color stop as a hexcode.

    Possible values: Value must match regular expression #[A-Fa-f0-9]{6}

    Example: #FF0000
  • ]

Responses

Success

Schema
    imageUrlstringrequired
    fileNamestringrequired