{
  "$id": "plan",
  "title": "[common] Payment plan object",
	"type": "object",
	"required": ["name", "description", "type", "payment_definitions"],
	"properties": {
		"id":                   { "type": "string", "minLength": 1 },
		"name":                 { "type": "string", "minLength": 1 },
		"description":          { "type": "string", "minLength": 1 },
		"type":                 { "$ref": "#/definitions/type" },
		"state":                { "type": "string", "minLength": 1 },
		"create_time":          { "type": "string", "minLength": 1 },
		"update_time":          { "type": "string", "minLength": 1 },
		"payment_definitions":  { "type": "array", "items": { "$ref": "common#/definitions/payment_definition" } },
		"terms":                { "type": "array", "items": { "$ref": "common#/definitions/term" } },
		"merchant_preferences": { "$ref": "common#/definitions/merchant_preferences"},
		"links":                { "type": "array", "items": { "$ref": "common#/definitions/links" } }
	},
  "definitions": {
    "meta": {
      "description": "Variable metadata object",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/feature"
      }
    },
    "level": {
      "type": "integer"
    },
    "feature": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "enum": ["boolean", "number"]
        },
        "value": {
          "type": "number",
          "description": "0/1 for boolean and any other number to compare with for number type"
        }
      }
    },
    "type": {
      "type": "string",
      "minLength": 1,
      "enum": ["fixed", "infinite", "FIXED", "INFINITE"]
    }
  }
}
