# Payment QR Code

## `POST /v1/QRCode`

Retrieve QR Code for a payment.

### Request

#### Headers

| Header        | Type     | Description                                                                                               |
| ------------- | -------- | --------------------------------------------------------------------------------------------------------- |
| Authorization | `string` | Auth token using `Basic` scheme. See [API Keys and Secrets](/api/authentication.md#api-keys-and-secrets). |

#### Query Parameters

| Attribute | Type     | Description                                                                                                         |
| --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| format    | `string` | ***Optional.*** Image format, `image/png` or `image/jpeg`. If not specified, the API returns Base64 encoded string. |

#### Request Body

| Attribute       | Type     | Description                                                                                                                                                                                                                                             |
| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Target          | `string` | The address of the payment receiver.                                                                                                                                                                                                                    |
| Signature       | `string` | Address Signature of the `Target` value, generate in the same way as [X-REQUEST-SIGNATURE](/api/authentication.md#x-request-signature).                                                                                                                 |
| Currency        | `string` | The [currency](/api/currency-and-conversion-symbols.md#currency-symbols) of the payment. Not supported for `BTC`.                                                                                                                                       |
| Amount          | `string` | Payment amount.                                                                                                                                                                                                                                         |
| MerchantOrderID | `string` | ***Optional.*** A string value attached to the payment which can be used for traceability between Gluwa and your application. ***Do not set this value to\*\*\*\* ****`blank`**** ****or**** ****`null`****. If you're not using it, just remove it.*** |
| Note            | `string` | ***Optional.*** Optional memo attached to the transaction. ***Do not set this value to\*\*\*\* ****`blank`**** ****or**** ****`null`****. If you're not using it, just remove it.***                                                                    |
| Expiry          | `int`    | ***Optional.*** The lifetime of the QR code in seconds. By default, the QR code will expire in 10 minutes. ***Do not set this value to\*\*\*\* ****`blank`**** ****or**** ****`null`****. If you're not using it, just remove it.***                    |

### Response

| HTTP Status | Return Object                                   |
| ----------- | ----------------------------------------------- |
| 200         | Base64 encoded image or `.png` or `.jpeg` file. |

### Errors

| HTTP Status | Error Code             | Description                                                                                                                     |
| ----------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                                                                                                          |
| 400         | `MissingBody`          | Request body is missing.                                                                                                        |
| 400         | `InvalidBody`          | Request validation errors.                                                                                                      |
| 400         | `ValidationError`      | Request validation errors.                                                                                                      |
| 400         | `BadRequest`           | Unsupported `format` query parameter value.                                                                                     |
| 403         | `Forbidden`            | Not authorized to use this endpoint. Make sure your authorization header is correct and you are using valid API key and secret. |
| 500         | `InternalServerError`  | Server error.                                                                                                                   |
| 503         | `ServiceUnavailable`   | Service unavailable for the specified currency.                                                                                 |


---

# 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.gluwa.com/api/qr-code.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.
