{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/1password/json-schema/1password-contract-schema.json",
  "title": "Contract",
  "description": "A contract",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/1password-contracts-api-openapi.yml#/components/schemas/Contract",
  "type": "object",
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The contract's SaaS Manager ID. Supply to update an existing contract."
    },
    "externalId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Your own external ID for the contract. Supply to match an existing contract on update."
    },
    "ref": {
      "type": [
        "string",
        "null"
      ],
      "description": "A reference for the contract, e.g. a PO number"
    },
    "type": {
      "allOf": [
        {
          "$ref": "#/$defs/ContractType"
        }
      ],
      "description": "The contract type"
    },
    "vendorName": {
      "type": [
        "string",
        "null"
      ],
      "description": "The vendor name"
    },
    "startDate": {
      "type": [
        "string",
        "null"
      ],
      "description": "(ISO format) The contract's start date",
      "format": "date-time"
    },
    "agreementDate": {
      "type": [
        "string",
        "null"
      ],
      "description": "(ISO format) The agreement date. Defaults to now on creation.",
      "format": "date-time"
    },
    "renewalDate": {
      "type": [
        "string",
        "null"
      ],
      "description": "(ISO format) The renewal date",
      "format": "date-time"
    },
    "isRolling": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Whether the contract is a rolling contract"
    },
    "terminationNoticeDays": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The number of days' notice required to terminate the contract",
      "format": "int32"
    },
    "isAutomaticRenewal": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Whether the contract renews automatically"
    },
    "notes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Notes about the contract"
    },
    "paymentMethod": {
      "allOf": [
        {
          "$ref": "#/$defs/AppLicensePaymentMethod"
        }
      ],
      "description": "The payment method"
    },
    "businessOwnerEmail": {
      "type": [
        "string",
        "null"
      ],
      "description": "The email address of the contract's business owner"
    },
    "lineItems": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ContractLineItem"
      },
      "description": "The contract's line items"
    },
    "documents": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ContractDocument"
      },
      "description": "Documents linked to the contract"
    },
    "createdBy": {
      "allOf": [
        {
          "$ref": "#/$defs/UserInfo"
        }
      ],
      "description": "The user that created the contract record",
      "readOnly": true
    },
    "createdDtm": {
      "type": [
        "string",
        "null"
      ],
      "description": "The timestamp for when the contract record was created",
      "format": "date-time",
      "readOnly": true
    },
    "lastModifiedBy": {
      "allOf": [
        {
          "$ref": "#/$defs/UserInfo"
        }
      ],
      "description": "The user that last modified the contract record",
      "readOnly": true
    },
    "lastModifiedDtm": {
      "type": [
        "string",
        "null"
      ],
      "description": "The timestamp for when the contract record was last modified",
      "format": "date-time",
      "readOnly": true
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AppLicensePaymentMethod": {
      "enum": [
        "CreditCard",
        "Invoice"
      ],
      "type": "string"
    },
    "ContractDocument": {
      "type": "object",
      "properties": {
        "linkUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "A URL linking to the document"
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "A description of the document"
        }
      },
      "additionalProperties": false,
      "description": "A document linked to a contract"
    },
    "ContractLineItem": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Your own external ID for the line item. Either all line items have one, or none do."
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "A description of the line item"
        },
        "notes": {
          "type": [
            "string",
            "null"
          ],
          "description": "Notes about the line item"
        },
        "unitCount": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The number of units",
          "format": "int32"
        },
        "amount": {
          "type": [
            "number",
            "null"
          ],
          "description": "The amount, in the currency given by currency",
          "format": "double"
        },
        "currency": {
          "type": [
            "string",
            "null"
          ],
          "description": "The ISO currency code for amount. Defaults to your base currency."
        },
        "baseAmount": {
          "type": [
            "number",
            "null"
          ],
          "description": "The amount converted to your base currency",
          "format": "double",
          "readOnly": true
        },
        "baseCurrency": {
          "type": [
            "string",
            "null"
          ],
          "description": "Your base ISO currency code",
          "readOnly": true
        },
        "startDate": {
          "type": [
            "string",
            "null"
          ],
          "description": "(ISO format) The line item's start date",
          "format": "date-time"
        },
        "endDate": {
          "type": [
            "string",
            "null"
          ],
          "description": "(ISO format) The line item's end date",
          "format": "date-time"
        }
      },
      "additionalProperties": false,
      "description": "A line item on a contract"
    },
    "ContractType": {
      "enum": [
        "OrderForm",
        "MSA",
        "GenericContract",
        "PurchaseOrder",
        "Subscription"
      ],
      "type": "string"
    },
    "UserInfo": {
      "type": "object",
      "properties": {
        "userId": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    }
  }
}