{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-qr-code-schema.json",
  "title": "QrCode",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-qr-codes-api-openapi.yml#/components/schemas/QrCode",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique QR code identifier. Prefix: qr_"
    },
    "entity": {
      "type": "string",
      "enum": [
        "qr_code"
      ]
    },
    "name": {
      "type": "string",
      "description": "Label for the QR code."
    },
    "description": {
      "type": "string"
    },
    "image_url": {
      "type": "string",
      "description": "Hosted URL of the QR code image."
    },
    "payment_amount": {
      "type": "integer",
      "description": "Fixed payment amount in paise. Null for variable-amount QR codes."
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "closed"
      ]
    },
    "usage_type": {
      "type": "string",
      "enum": [
        "single_use",
        "multiple_use"
      ]
    },
    "close_by": {
      "type": "integer",
      "description": "Unix timestamp when the QR code will auto-close."
    },
    "closed_at": {
      "type": "integer",
      "description": "Unix timestamp when the QR code was closed."
    },
    "close_reason": {
      "type": "string",
      "enum": [
        "on_demand",
        "paid"
      ],
      "description": "Why the QR code was closed."
    },
    "customer_id": {
      "type": "string",
      "description": "Associated customer ID (cust_*)."
    },
    "payments_amount_received": {
      "type": "integer",
      "description": "Total amount received via this QR code (paise)."
    },
    "payments_count_received": {
      "type": "integer",
      "description": "Number of payments received."
    },
    "notes": {
      "$ref": "#/$defs/Notes"
    },
    "created_at": {
      "type": "integer"
    }
  },
  "$defs": {
    "Notes": {
      "type": "object",
      "description": "Key-value pairs for storing custom metadata. Maximum 15 pairs. Each key and value must not exceed 256 characters.",
      "additionalProperties": {
        "type": "string"
      },
      "maxProperties": 15
    }
  }
}