> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.pdfgeneratorapi.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Generate QR Code via API

The [Generate QR Code](https://docs.pdfgeneratorapi.com/v4#tag/Assets/operation/generateQRCode) endpoint creates a QR code image from a string of data you provide. You can customise its appearance by changing the color or embedding a logo directly in the centre. The generated QR code is saved as an asset in your library, making it easy to reuse across multiple documents.
---

Key parameters include:

* **`content`** – The text or URL you want to encode.
* **`color`** – The colour of the QR code in hexadecimal format (e.g., `#000000` for black).
* **`logo_url`** or **`logo_base64`** – A URL or base64 string for an image to be placed in the centre of the QR code.
* **`output`** - The format for the response, which can be a URL or a base64 string.
---

#### Endpoint Details

* **HTTP Method:** `POST`
* **Request URL:** `https://us1.pdfgeneratorapi.com/api/v4/assets/qrcode`
* **Documentation: **[Official API Docs](https://docs.pdfgeneratorapi.com/v4#tag/Assets/operation/generateQRCode)

###### Request Body

This request generates a QR code with a custom blue colour that links to our homepage.

```
{
  "content": "https://pdfgeneratorapi.com",
  "color": "#7CCBB2",
  "logo_base64": "iVBORw0KGgoAAAANSUhEUgAAA1AAAAMzCAYAAA...",
  "output": "base64"
}
```

###### Response

The API returns a base64 encoded QR code image, along with metadata about the asset.

```
{
  "response": "JVBERi0xLjcKJeLjz9MKNyAwIG9iago8PCAvVHlwZSA...",
  "meta": {
    "encoding": "base64",
    "content-type": "image/png"
  }
}
```


![Generated QR code](https://storage.crisp.chat/users/helpdesk/website/-/1/1/e/0/11e0e518fc48ce00/image_ntwy8n.png =500x498)

---

### Related articles you may find helpful

* [Extract and Fill Existing PDF Forms Programmatically](https://support.pdfgeneratorapi.com/en/article/extract-and-fill-existing-pdf-forms-programmatically-zeb6c9/)
* [How to Create a Form](https://support.pdfgeneratorapi.com/en/article/how-to-create-a-form-152rrmx/)
* [Polish Your PDFs – Add Watermarks & Optimize](https://support.pdfgeneratorapi.com/en/article/polish-your-pdfs-add-watermarks-optimize-sh3rpx/)