{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/plugsurfing/json-schema/plugsurfing-product-schema.json",
  "title": "Product",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/plugsurfing-vouchers-api-openapi.yml#/components/schemas/Product",
  "oneOf": [
    {
      "$ref": "#/$defs/PrepaidProduct"
    },
    {
      "$ref": "#/$defs/UserGroupProduct"
    }
  ],
  "$defs": {
    "PrepaidProduct": {
      "type": "object",
      "required": [
        "type",
        "amountMinorUnits",
        "currencyCode"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "PREPAID"
          ]
        },
        "amountMinorUnits": {
          "type": "integer",
          "format": "int64",
          "description": "Amount in currency minor units. In the example 10.5 Euro is represented as 1050."
        },
        "currencyCode": {
          "type": "string",
          "description": "ISO 4217"
        }
      }
    },
    "UserGroupProduct": {
      "type": "object",
      "required": [
        "type",
        "groupId"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "USER_GROUP"
          ],
          "description": "Type of user-group product."
        },
        "customerGroupId": {
          "type": "integer",
          "description": "Identifier of the customer group granted by the product."
        }
      },
      "description": "Voucher product that grants access to a user group."
    }
  }
}