> For the complete documentation index, see [llms.txt](https://docs.maibmerchants.md/mia-qr-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maibmerchants.md/mia-qr-api/en/endpoints/payment-initiation/create-qr-code-static-dynamic.md).

# Create QR Code (Static, Dynamic)

**POST `/v2/mia/qr`**

This endpoint allows the generation of a **Static** or **Dynamic** QR code, with various configuration options related to the amount, expiration, and integration into merchant systems.

#### Request parameters (body)

| Field         | Type               | Required                          | Description                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------- | ------------------ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`        | `string(enum)`     | Yes                               | <p>QR code type.<br>Possible values: <code>Static</code>, <code>Dynamic</code>.</p><ul><li><code>Static</code>: QR code that can be reused multiple times (e.g., sticker).</li><li><code>Dynamic</code>: QR code intended for single-use (e.g., POS terminal).</li></ul>                                                                                                                                      |
| `expiresAt`   | `string(datetime)` | Yes, only for `Dynamic`           | <p>Expiration date for a Dynamic QR code.</p><ul><li>Minimum value: 1 minute</li><li>Maximum value: 60 days</li><li>Format: ISO 8601-1:2019 (e.g., <code>"2029-10-22T10:32:28+03:00"</code>)</li></ul><p>This field is not used for <code>Static</code> QR codes.</p>                                                                                                                                         |
| `amountType`  | `string(enum)`     | Yes                               | <p><br>Type of amount. Possible values:</p><ul><li><code>Fixed</code> – fixed amount (uses <code>amount</code>)</li><li><code>Controlled</code> – variable amount with min and max limits (<code>amountMin</code> and <code>amountMax</code>)</li><li><code>Free</code> – available only for <code>Static</code> QR codes; no predefined amount (the customer enters the amount in the banking app)</li></ul> |
| `amount`      | `number(decimal)`  | Yes, for `Fixed` and `Controlled` | <p></p><p>Paid amount. Must respect the condition: <code>amountMin ≤ amount ≤ amountMax</code>.</p><ul><li>Minimum: > 0</li><li>Maximum: 100000</li></ul><p>Not sent for <code>Free</code> amount type.</p>                                                                                                                                                                                                   |
| `amountMin`   | `number(decimal)`  | Yes, for `Controlled`             | <p></p><p>Minimum allowed amount.</p><ul><li>Minimum: > 0</li><li>Maximum: less than <code>amountMax</code></li></ul><p>Not sent for <code>Free</code> or <code>Fixed</code> amount types.</p>                                                                                                                                                                                                                |
| `amountMax`   | `number(decimal)`  | Yes, for `Controlled`             | <p></p><p>Maximum allowed amount.</p><ul><li>Minimum: greater than <code>amountMin</code></li><li>Maximum: 100000</li></ul><p>Not sent for <code>Free</code> or <code>Fixed</code> amount types.</p>                                                                                                                                                                                                          |
| `currency`    | `string(enum)`     | Yes                               | <p>Currency in which the payment is made.<br>Allowed value: <code>MDL</code> (according to ISO 4217).</p>                                                                                                                                                                                                                                                                                                     |
| `description` | `string(500)`      | Yes                               | Order description.                                                                                                                                                                                                                                                                                                                                                                                            |
| `orderId`     | `string(100)`      | No                                | Merchant-side order identifier.                                                                                                                                                                                                                                                                                                                                                                               |
| `callbackUrl` | `string(1000)`     | No                                | <p>The URL where the merchant will receive payment result data.<br>Format: HTTPS URL.</p>                                                                                                                                                                                                                                                                                                                     |
| `terminalId`  | `string(100)`      | No                                | Terminal ID provided by the bank.                                                                                                                                                                                                                                                                                                                                                                             |

#### Request example

```json
{
    "type": "Dynamic",
    "expiresAt": "2029-10-22T10:32:28+03:00",
    "amountType": "Fixed",
    "amount": 50.00,
    "currency": "MDL",
    "description": "Order description",
    "orderId": "123",
    "callbackUrl": "https://example.com/callback",
    "terminalId": "P011111"
}
```

***

#### Response parameters

| Field                 | Type               | Description                                                         |
| --------------------- | ------------------ | ------------------------------------------------------------------- |
| `result.qrId`         | `string(guid)`     | Unique identifier of the QR code.                                   |
| `result.extensionId`  | `string(guid)`     | QR extension identifier.                                            |
| `result.orderId`      | `string(100)`      | Merchant's order ID.                                                |
| `result.type`         | `string(enum)`     | Returned QR type. Possible values: `Static`, `Dynamic`, `Hybrid`.   |
| `result.url`          | `string(1000)`     | Generated QR link. Format: HTTPS URL                                |
| `result.expiresAt`    | `string(datetime)` | QR expiration date (for Dynamic or Hybrid). Format: ISO 8601-1:2019 |
| `ok`                  | `boolean`          | Request status. `true` – no errors, `false` – with errors.          |
| `errors`              | `array`            | Errors list (if `ok` is `false`).                                   |
| `errors.errorCode`    | `string`           | Error code.                                                         |
| `errors.errorMessage` | `string`           | Error message.                                                      |

#### Response example

```json
{
    "result": {
        "qrId": "123e4567-e89b-12d3-a456-426614174000",
        "extensionId": "40e6ba44-7dff-48cc-91ec-386a38318c68",
        "orderId": "123",
        "type": "Dynamic",
        "url": "https://example.com/qr/123e4567-e89b-12d3-a456-426614174000",
        "expiresAt": "2029-10-22T10:32:28+03:00"
    },
    "ok": true
}
```
