# QR Code Generator

The Tebex Unity SDK includes a QR code generator that can create a `Texture2D` of a Tebex checkout link.&#x20;

No additional dependencies are required in your project to generate the code.

This enables customers to checkout with a mobile device by scanning a code shown in-game.

<figure><img src="https://924803319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaRz9HUAxrYuZsSDWhYnu%2Fuploads%2Fq4hV5artebFH4pjBLLhh%2Fimage.png?alt=media&#x26;token=030ea674-3993-485a-af06-2466d93e50e3" alt=""><figcaption></figcaption></figure>

### Displaying a QR Code

QR codes can be generated by using

```
Utilities.QrToTexture(QrCode.Encode("https://tebex.io/path/to/checkout"));
```

which will create a `Texture2D` containing the QR code.

You can customize the `scale` and `quietZone` (whitespace) of the generated QR code.

{% hint style="info" %}
The QR code generator will only create codes for URLs that direct to a Tebex basket.
{% endhint %}

### Using with the In Game Cart

The in-game cart can be configured to enable or disable showing QR codes, per your requirements.&#x20;

This can be toggled on/off via the Inspector on the GameObject where you have attached the InGameCart component.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tebex.io/developers/unity-engine/features/qr-code-generator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
