{
  "openapi": "3.1.0",
  "info": {
    "title": "Rahunok NBU QR API",
    "version": "1.0.0",
    "description": "Create a National Bank of Ukraine (NBU) payment QR code for an IBAN transfer from plain fields. Free, no authentication.",
    "contact": {
      "name": "Rahunok",
      "url": "https://rahunok.com/instrumenty/generator-qr-nbu/",
      "email": "rahunok@rahunok.com"
    }
  },
  "servers": [
    {
      "url": "https://rahunok.com"
    }
  ],
  "paths": {
    "/api/qr/nbu.png": {
      "get": {
        "operationId": "createNbuQrPng",
        "summary": "Create an NBU payment QR code as a PNG image",
        "parameters": [
          {
            "name": "recipient",
            "in": "query",
            "required": true,
            "description": "Recipient name, up to 70 characters.",
            "schema": {
              "type": "string",
              "maxLength": 70
            }
          },
          {
            "name": "tax_id",
            "in": "query",
            "required": true,
            "description": "EDRPOU (8 digits) or RNOKPP (10 digits) of the recipient.",
            "schema": {
              "type": "string",
              "pattern": "^(\\d{8}|\\d{10})$"
            }
          },
          {
            "name": "iban",
            "in": "query",
            "required": true,
            "description": "Ukrainian IBAN: UA followed by 27 digits.",
            "schema": {
              "type": "string",
              "pattern": "^UA\\d{27}$"
            }
          },
          {
            "name": "purpose",
            "in": "query",
            "required": true,
            "description": "Payment purpose, up to 140 characters.",
            "schema": {
              "type": "string",
              "maxLength": 140
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "description": "Amount in UAH with up to 2 decimals. Omit it and the payer enters any amount.",
            "schema": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "description": "Image size in pixels.",
            "schema": {
              "type": "integer",
              "minimum": 256,
              "maximum": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "QR code image",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "parameter": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/qr/nbu.svg": {
      "get": {
        "operationId": "createNbuQrSvg",
        "summary": "Create an NBU payment QR code as an SVG image",
        "parameters": [
          {
            "name": "recipient",
            "in": "query",
            "required": true,
            "description": "Recipient name, up to 70 characters.",
            "schema": {
              "type": "string",
              "maxLength": 70
            }
          },
          {
            "name": "tax_id",
            "in": "query",
            "required": true,
            "description": "EDRPOU (8 digits) or RNOKPP (10 digits) of the recipient.",
            "schema": {
              "type": "string",
              "pattern": "^(\\d{8}|\\d{10})$"
            }
          },
          {
            "name": "iban",
            "in": "query",
            "required": true,
            "description": "Ukrainian IBAN: UA followed by 27 digits.",
            "schema": {
              "type": "string",
              "pattern": "^UA\\d{27}$"
            }
          },
          {
            "name": "purpose",
            "in": "query",
            "required": true,
            "description": "Payment purpose, up to 140 characters.",
            "schema": {
              "type": "string",
              "maxLength": 140
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "description": "Amount in UAH with up to 2 decimals. Omit it and the payer enters any amount.",
            "schema": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "description": "Image size in pixels.",
            "schema": {
              "type": "integer",
              "minimum": 256,
              "maximum": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "QR code image",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "parameter": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}