{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/keysavvy/json-schema/keysavvy-deal-report-search-request-body-schema.json",
  "title": "DealReportSearchRequestBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/keysavvy-reporting-api-openapi.yml#/components/schemas/DealReportSearchRequestBody",
  "type": "object",
  "properties": {
    "cursor": {
      "type": "string",
      "description": "Return the page of results after this cursor. If not provided, the first page will be returned."
    },
    "limit": {
      "type": "integer",
      "description": "The number of results to return per page. Defaults to 25. Max is 25.",
      "minimum": 1,
      "maximum": 25
    },
    "sortBy": {
      "type": "string",
      "description": "The field to sort by. If not provided, defaults to createdAt."
    },
    "order": {
      "description": "The order to sort by. Defaults to ASC.",
      "$ref": "#/$defs/SortOrderEnum"
    },
    "status": {
      "$ref": "#/$defs/DealStatusEnum"
    },
    "createdAt": {
      "$ref": "#/$defs/SearchCriteriaDateTime"
    },
    "paymentVerifiedAt": {
      "$ref": "#/$defs/SearchCriteriaDateTime"
    },
    "transferConfirmedAt": {
      "$ref": "#/$defs/SearchCriteriaDateTime"
    },
    "titleSentAt": {
      "$ref": "#/$defs/SearchCriteriaDateTime"
    }
  },
  "$defs": {
    "DealStatusEnum": {
      "type": "string",
      "enum": [
        "IN_PROGRESS",
        "COMPLETED",
        "CANCELED"
      ],
      "description": "Indicates the overall status of this deal:\n\n * `IN_PROGRESS` - The default state of a deal.\n\n * `COMPLETED` - This deal was successful and the vehicle has been transferred. Users should\nstill be provided a way of reaching the `dealUrl` so they can access document records. This is a terminal state, at this point, `actionRequired` will not be `true` again, and the status will not change back to `IN_PROGRESS`.\n\n * `CANCELED` - This deal is incomplete, and is no longer completable. This state can occur\nfor a number of reasons: abandonment, vehicle sold, vehicle removed, user request. This is a terminal state, at this point, `actionRequired` will not be `true` again, and the status will not change back to `IN_PROGRESS`.\n"
    },
    "SearchCriteriaDateTime": {
      "type": "object",
      "properties": {
        "gte": {
          "type": "string",
          "format": "date-time"
        },
        "lte": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "SortOrderEnum": {
      "type": "string",
      "enum": [
        "ASC",
        "DESC"
      ]
    }
  }
}