{
  "openapi": "3.0.4",
  "info": {
    "title": "SBQR.Api | v1.public",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "http://sbqr-api.dgi-rnd.com/"
    }
  ],
  "paths": {
    "/v1/billing/statements": {
      "get": {
        "tags": [
          "TenantBilling"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TenantStatementResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/statements/{period}": {
      "get": {
        "tags": [
          "TenantBilling"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantStatementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/usage": {
      "get": {
        "tags": [
          "TenantBilling"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "meter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "billable",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsagePageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/usage/summary": {
      "get": {
        "tags": [
          "TenantBilling"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageSummaryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/login": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/LoginRequest"
                  }
                ],
                "nullable": true
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/LoginRequest"
                  }
                ],
                "nullable": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/refresh": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/RefreshRequest"
                  }
                ],
                "nullable": true
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/RefreshRequest"
                  }
                ],
                "nullable": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/logout": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/LogoutRequest"
                  }
                ],
                "nullable": true
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/LogoutRequest"
                  }
                ],
                "nullable": true
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/me": {
      "get": {
        "tags": [
          "Auth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/change-password": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ChangePasswordRequest"
                  }
                ],
                "nullable": true
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ChangePasswordRequest"
                  }
                ],
                "nullable": true
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/oauth/token": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qr/generate/static": {
      "post": {
        "tags": [
          "QrGeneration"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateStaticQrRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateStaticQrRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateStaticQrRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateQrResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qr/generate/dynamic": {
      "post": {
        "tags": [
          "QrGeneration"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateDynamicQrRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateDynamicQrRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateDynamicQrRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateQrResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/qr/validate": {
      "post": {
        "tags": [
          "QrValidation"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateQrRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateQrRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateQrRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidateQrResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/health/live": {
      "get": {
        "tags": [
          "SBQR.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/health/ready": {
      "get": {
        "tags": [
          "SBQR.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/": {
      "get": {
        "tags": [
          "SBQR.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AuthErrorResponse": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "ChangePasswordRequest": {
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string"
          },
          "newPassword": {
            "type": "string"
          }
        }
      },
      "GenerateDynamicQrRequest": {
        "required": [
          "transactionAmount",
          "recipientName",
          "recipientCity",
          "recipientPan"
        ],
        "type": "object",
        "properties": {
          "transactionAmount": {
            "type": "string"
          },
          "recipientName": {
            "type": "string"
          },
          "recipientCity": {
            "type": "string"
          },
          "recipientPan": {
            "type": "string"
          },
          "postalCode": {
            "type": "string",
            "nullable": true
          },
          "customerLabel": {
            "type": "string",
            "nullable": true
          },
          "purposeOfTransaction": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "GenerateQrResponse": {
        "required": [
          "qrPayload",
          "payloadHash",
          "qrType",
          "signatureKeyVersion",
          "signatureKeyValidUntil"
        ],
        "type": "object",
        "properties": {
          "qrPayload": {
            "type": "string"
          },
          "payloadHash": {
            "type": "string"
          },
          "qrType": {
            "type": "string"
          },
          "signatureKeyVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "format": "int32"
          },
          "signatureKeyValidUntil": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "GenerateStaticQrRequest": {
        "required": [
          "recipientName",
          "recipientCity",
          "recipientPan"
        ],
        "type": "object",
        "properties": {
          "recipientName": {
            "type": "string"
          },
          "recipientCity": {
            "type": "string"
          },
          "recipientPan": {
            "type": "string"
          },
          "postalCode": {
            "type": "string",
            "nullable": true
          },
          "customerLabel": {
            "type": "string",
            "nullable": true
          },
          "purposeOfTransaction": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "LoginRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string"
          }
        }
      },
      "LoginResponse": {
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "tokenType": {
            "type": "string"
          },
          "expiresIn": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "format": "int32"
          },
          "refreshToken": {
            "type": "string",
            "nullable": true
          },
          "refreshTokenExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "user": {
            "$ref": "#/components/schemas/LoginResponseUser"
          }
        }
      },
      "LoginResponseUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "username": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "mustChangePassword": {
            "type": "boolean"
          }
        }
      },
      "LogoutRequest": {
        "type": "object",
        "properties": {
          "refreshToken": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "MeResponse": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "mustChangePassword": {
            "type": "boolean"
          }
        }
      },
      "OAuthErrorResponse": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "RefreshRequest": {
        "type": "object",
        "properties": {
          "refreshToken": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "RefreshResponse": {
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "tokenType": {
            "type": "string"
          },
          "expiresIn": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "format": "int32"
          },
          "refreshToken": {
            "type": "string",
            "nullable": true
          },
          "refreshTokenExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "user": {
            "$ref": "#/components/schemas/LoginResponseUser"
          }
        }
      },
      "StatementLineResponse": {
        "required": [
          "lineNo",
          "lineType",
          "meterCode",
          "adjustmentId",
          "description",
          "quantity",
          "unitRate",
          "amount"
        ],
        "type": "object",
        "properties": {
          "lineNo": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "format": "int32"
          },
          "lineType": {
            "type": "string"
          },
          "meterCode": {
            "type": "string",
            "nullable": true
          },
          "adjustmentId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "description": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "format": "int64"
          },
          "unitRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "format": "double"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "format": "double"
          }
        }
      },
      "StatementResponse": {
        "required": [
          "tenantId",
          "rateCardId",
          "generationRate",
          "validationRate",
          "lines",
          "subtotal",
          "adjustmentsTotal",
          "total",
          "currency",
          "calculatedAt"
        ],
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "rateCardId": {
            "type": "string",
            "format": "uuid"
          },
          "generationRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "format": "double"
          },
          "validationRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "format": "double"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatementLineResponse"
            }
          },
          "subtotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "format": "double"
          },
          "adjustmentsTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "format": "double"
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "calculatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TenantStatementResponse": {
        "required": [
          "period",
          "status",
          "finalizedAt",
          "statement"
        ],
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "finalizedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "statement": {
            "$ref": "#/components/schemas/StatementResponse"
          }
        }
      },
      "TokenResponse": {
        "required": [
          "accessToken",
          "tokenType",
          "expiresIn"
        ],
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "tokenType": {
            "type": "string"
          },
          "expiresIn": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "format": "int32"
          }
        }
      },
      "UsageDayResponse": {
        "required": [
          "day",
          "tenantId",
          "meterCode",
          "billable",
          "count"
        ],
        "type": "object",
        "properties": {
          "day": {
            "type": "string"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "meterCode": {
            "type": "string"
          },
          "billable": {
            "type": "boolean"
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "format": "int64"
          }
        }
      },
      "UsageEventResponse": {
        "required": [
          "usageEventId",
          "tenantId",
          "meterCode",
          "billable",
          "verdict",
          "clientReference",
          "occurredAt"
        ],
        "type": "object",
        "properties": {
          "usageEventId": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "meterCode": {
            "type": "string"
          },
          "billable": {
            "type": "boolean"
          },
          "verdict": {
            "type": "string",
            "nullable": true
          },
          "clientReference": {
            "type": "string"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UsagePageResponse": {
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageEventResponse"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "UsageSummaryResponse": {
        "required": [
          "from",
          "to",
          "days"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageDayResponse"
            }
          }
        }
      },
      "ValidateQrRequest": {
        "required": [
          "qrPayload"
        ],
        "type": "object",
        "properties": {
          "qrPayload": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "nullable": true
          },
          "requestTimestamp": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "ValidateQrResponse": {
        "required": [
          "verdict",
          "trustSource",
          "reasonCode",
          "institutionCode",
          "payloadHash",
          "recipientName",
          "recipientPan",
          "qrClassification"
        ],
        "type": "object",
        "properties": {
          "verdict": {
            "type": "string"
          },
          "trustSource": {
            "type": "string",
            "nullable": true
          },
          "reasonCode": {
            "type": "string",
            "nullable": true
          },
          "institutionCode": {
            "type": "string",
            "nullable": true
          },
          "payloadHash": {
            "type": "string"
          },
          "recipientName": {
            "type": "string",
            "nullable": true
          },
          "recipientPan": {
            "type": "string",
            "nullable": true
          },
          "qrClassification": {
            "type": "string"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "TenantBilling"
    },
    {
      "name": "Auth"
    },
    {
      "name": "OAuth"
    },
    {
      "name": "QrGeneration"
    },
    {
      "name": "QrValidation"
    },
    {
      "name": "SBQR.Api"
    }
  ]
}