> **Description:** QR code formats

# QR code formats

The QR code image will be returned as a URL in the response for one-time
payment, merchant redirect and merchant callback QR codes. Opening this URL will return the image
in the format and resolution set in the request. The URL to the image
will look like this:

```json
"url":"https://qr-generator-prod-app-service.azurewebsites.net/qr-generator/v1?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...."
```

The URL to the image does not require any authentication and can be shown
wherever you want. Note that one-time payment QR codes eventually will time out -
trying to open the URL to the one-time payment QR image after its expiry
will return a `404 Not Found` error. Merchant redirect QR codes can be opened forever.

## QR Image format

The API currently supports generating QR codes in either `PNG` or `SVG` image formats. If `PNG` is chosen, it is also possible to set the resolution of the image.

Set the Accept HTTP Header to either `Accept: image/png` or `Accept: image/svg+xml`.

## Setting QR image size

If a `PNG` image is selected, the `size` parameter can be used to set the resolution of the
image. The example below sets the image to 600 x 600 pixels:

```json
{
  "url": "https://api.vippsmobilepay.com/...",
  "size": 600
}
```

The smallest image you can set is 100 x 100 pixels and the largest is 2000 x 2000 pixels.
If left out, the image is set to 1024 x 1024 pixels by default.

## Adding white border

In order to add a white border to the QR code image, add the parameter
`whiteBorder` with the width of the border in pixels.

```json
{
  "url": "https://api.vippsmobilepay.com/...",
  "whiteBorder": 10
}
```

`whiteBorder` can be a minimum of 0 and a maximum of 100. If left out,
`whiteBorder` is set to 8 by default.

> **Full site overview:** For every page in this documentation, read [https://developer.vippsmobilepay.com/llms.txt](https://developer.vippsmobilepay.com/llms.txt).
