{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/vessel/refs/heads/main/json-schema/vessel-deal-schema.json",
  "title": "Deal",
  "description": "(Alias: Opportunity) An object representing either the opportunity to sell a product to an Account, or in the case of an `isWon` deal, a product sold to an Account.\n*CRM Caveats*:\n- Pipedrive: Users must have \"Deal probability\" turned on for the given pipeline for probability to be configurable and returned.",
  "x-provenance": {
    "generated": "2026-08-13",
    "method": "derived",
    "source": "openapi/vessel-crm-openapi.yml#/components/schemas/Deal",
    "note": "Extracted verbatim from the schema Vessel publishes in its own OpenAPI 3.1.0 definition. No fields were added, renamed or invented."
  },
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id of the object in the connected CRM."
    },
    "name": {
      "type": "string",
      "description": "Optional name for this deal"
    },
    "stage": {
      "type": "string",
      "description": "The stage of the pipeline the deal is in. See /deal/details for possible values"
    },
    "amount": {
      "type": "number",
      "description": "Total deal money value"
    },
    "closeDate": {
      "type": "string",
      "description": "When this deal is projected to be closed"
    },
    "probability": {
      "type": "string",
      "description": "Decimal probability of closing this deal."
    },
    "expectedRevenue": {
      "type": "number",
      "description": "probability * amount. This is a computed property"
    },
    "isWon": {
      "type": "boolean",
      "description": "If this deal has been won. This is a computed property based on stage"
    },
    "isClosed": {
      "type": "boolean",
      "description": "If this deal is closed (either closed-won or closed-lost). This is a computed property based on stage"
    },
    "currency": {
      "type": "string",
      "description": "The currency of the deal in ISO format. This can be null if the CRM does not support multiple currencies. See `/info/find` for default currency value"
    },
    "createdTime": {
      "type": "string",
      "description": "The timestamp that the deal was created"
    },
    "modifiedTime": {
      "type": "string",
      "description": "The timestamp the deal was last modified"
    },
    "associations": {
      "type": "object",
      "required": [
        "contactIds",
        "accountIds",
        "ownerUserId"
      ],
      "properties": {
        "contactIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "accountIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "ownerUserId": {
          "type": "string",
          "description": "The Id of the User that owns this Deal"
        }
      }
    },
    "$native": {
      "$ref": "#/components/schemas/NativeData"
    }
  },
  "required": [
    "id",
    "name",
    "closeDate",
    "createdTime",
    "modifiedTime",
    "associations"
  ]
}