{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/saasrfp-com/json-schema/saasrfp-com-rfp-schema.json",
  "title": "Rfp",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/saasrfp-com-openapi.json#/components/schemas/Rfp",
  "allOf": [
    {
      "$ref": "#/$defs/RfpSummary"
    },
    {
      "type": "object",
      "properties": {
        "description": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "stats": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "label",
              "value"
            ],
            "additionalProperties": false
          }
        },
        "features": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RfpFeature"
          }
        },
        "bids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BidSummary"
          }
        },
        "bidUrl": {
          "type": "string",
          "description": "The URL a seller opens to bid by hand."
        }
      },
      "required": [
        "description",
        "stats",
        "features",
        "bids",
        "bidUrl"
      ],
      "additionalProperties": false
    }
  ],
  "$defs": {
    "BidSummary": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "submitted",
            "shortlisted",
            "rejected",
            "accepted"
          ]
        },
        "product": {
          "type": "object",
          "properties": {
            "slug": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "slug",
            "name"
          ],
          "additionalProperties": false
        },
        "annualPrice": {
          "type": "number",
          "description": "Whole US dollars per year."
        },
        "savingsPercent": {
          "type": "number",
          "description": "Percent saved against the RFP's annual spend. Negative when the bid costs more."
        },
        "matchPercent": {
          "type": "number"
        },
        "seller": {
          "$ref": "#/$defs/Party"
        },
        "createdAt": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "status",
        "product",
        "annualPrice",
        "savingsPercent",
        "matchPercent",
        "seller",
        "createdAt",
        "url"
      ],
      "additionalProperties": false
    },
    "Party": {
      "type": "object",
      "properties": {
        "anonymous": {
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "handle": {
          "oneOf": [
            {
              "type": "string",
              "description": "Null when the party is anonymous to this caller."
            },
            {
              "type": "null"
            }
          ]
        },
        "company": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "url": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "anonymous",
        "name",
        "handle",
        "company",
        "url"
      ],
      "additionalProperties": false
    },
    "RfpFeature": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The RfpFeature id. A bid's coverage claims reference it."
        },
        "name": {
          "type": "string"
        },
        "importance": {
          "type": "string",
          "enum": [
            "must",
            "nice"
          ]
        },
        "usageNote": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "featureSlug": {
          "oneOf": [
            {
              "type": "string",
              "description": "The taxonomy feature slug, or null for a custom feature."
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "name",
        "importance",
        "usageNote",
        "featureSlug"
      ],
      "additionalProperties": false
    },
    "RfpSummary": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "awarded",
            "closed"
          ]
        },
        "vendor": {
          "type": "object",
          "properties": {
            "slug": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "slug",
            "name"
          ],
          "additionalProperties": false
        },
        "annualSpend": {
          "type": "number",
          "description": "Whole US dollars per year."
        },
        "seats": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "renewalDate": {
          "oneOf": [
            {
              "type": "string",
              "description": "ISO 8601 date."
            },
            {
              "type": "null"
            }
          ]
        },
        "featureCount": {
          "type": "integer"
        },
        "bidCount": {
          "type": "integer"
        },
        "bestMatchPercent": {
          "oneOf": [
            {
              "type": "number",
              "description": "The best match percent among visible bids."
            },
            {
              "type": "null"
            }
          ]
        },
        "lowestBid": {
          "oneOf": [
            {
              "type": "number",
              "description": "The lowest visible bid price in dollars."
            },
            {
              "type": "null"
            }
          ]
        },
        "buyer": {
          "$ref": "#/$defs/Party"
        },
        "createdAt": {
          "type": "string",
          "description": "ISO 8601 timestamp."
        },
        "url": {
          "type": "string"
        }
      },
      "required": [
        "slug",
        "title",
        "status",
        "vendor",
        "annualSpend",
        "seats",
        "renewalDate",
        "featureCount",
        "bidCount",
        "bestMatchPercent",
        "lowestBid",
        "buyer",
        "createdAt",
        "url"
      ],
      "additionalProperties": false
    }
  }
}