{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "available": {
      "type": "boolean"
    },
    "reason": {
      "anyOf": [
        {
          "type": "string",
          "enum": ["admin-required", "staff-only", "not-configured"]
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "plan": {
              "type": "string",
              "minLength": 1
            },
            "interval": {
              "type": "string",
              "enum": ["month", "year"]
            },
            "status": {
              "type": "string"
            },
            "currentPeriodEnd": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "cancelAtPeriodEnd": {
              "type": "boolean"
            },
            "lastInvoice": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": ["paid", "failed"]
                },
                {
                  "type": "null"
                }
              ]
            },
            "livemode": {
              "type": "boolean"
            },
            "scheduledChange": {
              "default": null,
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "plan": {
                      "type": "string",
                      "minLength": 1
                    },
                    "interval": {
                      "type": "string",
                      "enum": ["month", "year"]
                    },
                    "at": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": ["plan", "interval", "at"]
                },
                {
                  "type": "null"
                }
              ]
            },
            "endedFor": {
              "default": null,
              "anyOf": [
                {
                  "type": "string",
                  "enum": ["project-deleted", "project-transferred"]
                },
                {
                  "type": "null"
                }
              ]
            },
            "unpaid": {
              "default": null,
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "since": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "promotionsRefusedAt": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "offlineAt": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": ["since", "promotionsRefusedAt", "offlineAt"]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "plan",
            "interval",
            "status",
            "currentPeriodEnd",
            "cancelAtPeriodEnd",
            "lastInvoice",
            "livemode",
            "scheduledChange",
            "endedFor",
            "unpaid"
          ]
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": ["available", "reason", "subscription"]
}
