{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/kibo-commerce/main/json-schema/kibo-commerce-subscription-collection-schema.json",
  "title": "SubscriptionCollection",
  "description": "Collection of subscriptions returned as a whole.",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kibo-commerce-event-openapi.yml#/components/schemas/SubscriptionCollection",
  "properties": {
    "items": {
      "items": {
        "$ref": "#/$defs/Subscription"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "pageCount": {
      "format": "int32",
      "type": "integer"
    },
    "pageSize": {
      "format": "int32",
      "type": "integer"
    },
    "startIndex": {
      "format": "int32",
      "type": "integer"
    },
    "totalCount": {
      "format": "int32",
      "type": "integer"
    }
  },
  "type": "object",
  "$defs": {
    "AuditInfo": {
      "properties": {
        "createBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "createDate": {
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "updateBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "updateDate": {
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "SubscribingSite": {
      "description": "A site that is associated with a subscription",
      "properties": {
        "auditInfo": {
          "$ref": "#/$defs/AuditInfo"
        },
        "isActive": {
          "description": "Is the subscription active at the site level?",
          "type": [
            "boolean",
            "null"
          ]
        },
        "siteId": {
          "description": "The site identifier",
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "SubscribingTenant": {
      "description": "A tenant that is associated with a subscription",
      "properties": {
        "auditInfo": {
          "$ref": "#/$defs/AuditInfo"
        },
        "isActive": {
          "description": "Is the subscription active at the tenant level?  If the subscription context is at the Tenant Level this property will be utilized over the SiteLevel",
          "type": [
            "boolean",
            "null"
          ]
        },
        "subscribingContextLevelType": {
          "description": "Type of Subscribing Context\n!:SubscribingContextLevelTypeConst\nDerived from state of the subscription.  If any Subscribing Sites exist (e.g. subscription is not at the Tenant Level, then the value will be Site)",
          "type": [
            "string",
            "null"
          ]
        },
        "subscribingSites": {
          "description": "Subscribing Sites",
          "items": {
            "$ref": "#/$defs/SubscribingSite"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "tenantId": {
          "description": "The tenant identifier",
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "Subscription": {
      "description": "The subscription entity used specifically in PUSH event scenarios where a third-party desires to receive notification of events",
      "properties": {
        "apiVersion": {
          "description": "ApiVersion",
          "type": [
            "string",
            "null"
          ]
        },
        "appId": {
          "description": "Application identifier for subscription",
          "type": [
            "string",
            "null"
          ]
        },
        "confirmed": {
          "description": "A boolean value that indicates if the subscription endpoint has been confirmed",
          "type": [
            "boolean",
            "null"
          ]
        },
        "contentType": {
          "description": "Content type of the payload that will be delivered.  This is utilized in combination with the notification delivery type.  Example:  A HTTP Post (notification delivery type) is performed with a JSON representation of the event data (content type).",
          "type": [
            "string",
            "null"
          ]
        },
        "createBy": {
          "description": "Identifier of the user who created the entity. System-supplied and read-only.",
          "type": [
            "string",
            "null"
          ]
        },
        "createDate": {
          "description": "When the entity was created. System-supplied and read-only.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "endpoint": {
          "description": "The delivery endpoint that will receive notifications when events concerning the specified topics on the subscription occur.  The format of the endpoint may differ depending on the notification type.  For example, the endpoint may be a URL in some cases and an email address in others if multiple notification types are available.",
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "description": "The unique identifier for a subscription",
          "type": [
            "string",
            "null"
          ]
        },
        "isActive": {
          "description": "A boolean value that indicates if the subscription is active.  The subscription may be inactive due to repeated downtimes at the endpoint.  If they subscription is deactivated the subscription owner or application will need to reactivate it for notifications to be delivered.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "noCallback": {
          "description": "A boolean value that indicates if events should be delivered that resulted from an API call by the application.  If true, any events that occur as a result of a direct API call by the same application will not be delivered. This can prevent an endless loop in certain scenarios.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "notificationDeliveryType": {
          "description": "Notification delivery type which is a string representation of an enumeration of values.  Example: Http (this is case insensitive, so http may also be passed in)",
          "type": [
            "string",
            "null"
          ]
        },
        "subscribingTenants": {
          "description": "A list of subscribers or subscribing tenants that the subscription relates to",
          "items": {
            "$ref": "#/$defs/SubscribingTenant"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "topics": {
          "description": "A list of topics that the subscription relates to",
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "updateBy": {
          "description": "Identifier of the user who updated the entity. System-supplied and read-only.",
          "type": [
            "string",
            "null"
          ]
        },
        "updateDate": {
          "description": "When the entity was updated. System-supplied and read-only.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    }
  }
}