{
  "$id": "agreement.create",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "owner",
    "agreement"
  ],
  "properties": {
    "owner": {
      "$ref": "common#/definitions/owner"
    },
    "creatorTaskId": {
      "type": "string"
    },
    "agreement": {
      "allOf": [{
        "$ref": "agreement#"
      }, {
        "type": "object",
        "properties": {
          "plan": {
            "type": "object",
            "additionalProperties": false,
            "required": ["id"],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^P-[A-Z0-9]+$"
              }
            }
          }
        }
      }]
    },
    "trialDiscount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "default": 0
    },
    "trialCycle": {
      "type": "integer",
      "minimum": 1,
      "default": 12
    },
    "startDate": {
      "type": "string",
      "format": "date-time"
    },
    "setupFee": {
      "type": "string",
      "pattern": "^\\d+\\.\\d{1,2}$"
    },
    "skipSetupFee": {
      "type": "boolean",
      "default": false
    },
    "forceStartDate": {
      "type": "boolean",
      "default": false,
      "description": "True to set agreement start date as passed without any changes"
    }
  }
}
