{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/med-reveal-com/json-schema/med-reveal-com-provider-search-rates-request-schema.json",
  "title": "ProviderSearchRatesRequest",
  "description": "Request for provider-specific rate searches.\n\nRequires either npis OR tins (at least one must be provided).",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/med-reveal-com-openapi.json#/components/schemas/ProviderSearchRatesRequest",
  "properties": {
    "insurance": {
      "type": "string",
      "title": "Insurance",
      "description": "Insurance company code (uhc, cigna, aetna, bcbs, optum)"
    },
    "npis": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Npis",
      "description": "List of NPIs to search (required if tins not provided)"
    },
    "tins": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tins",
      "description": "List of TINs to search (required if npis not provided)"
    },
    "billingCodeAndTypes": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/BillingCodeWithType"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Billingcodeandtypes",
      "description": "List of billing codes with types"
    },
    "billingCodeModifiers": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Billingcodemodifiers",
      "description": "List of billing code modifiers"
    },
    "serviceCodes": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Servicecodes",
      "description": "List of service codes"
    },
    "billingClasses": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Billingclasses",
      "description": "List of billing classes"
    },
    "negotiatedTypes": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Negotiatedtypes",
      "description": "List of negotiated types"
    },
    "groupBy": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/ProviderSearchGroupByField"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Groupby",
      "description": "Fields to group results by"
    },
    "page": {
      "type": "integer",
      "minimum": 1.0,
      "title": "Page",
      "description": "Page number (1-indexed)",
      "default": 1
    },
    "pageSize": {
      "type": "integer",
      "maximum": 1000.0,
      "minimum": 1.0,
      "title": "Pagesize",
      "description": "Results per page",
      "default": 100
    }
  },
  "type": "object",
  "required": [
    "insurance"
  ],
  "$defs": {
    "BillingCodeWithType": {
      "properties": {
        "code": {
          "type": "string",
          "title": "Code",
          "description": "Billing code (e.g., '99213')"
        },
        "type": {
          "type": "string",
          "title": "Type",
          "description": "Code type: 'CPT' or 'HCPCS'"
        }
      },
      "type": "object",
      "required": [
        "code",
        "type"
      ],
      "title": "BillingCodeWithType",
      "description": "Billing code with its type (CPT or HCPCS)."
    },
    "ProviderSearchGroupByField": {
      "type": "string",
      "enum": [
        "payer",
        "npi_state",
        "taxonomy_code",
        "entity_type",
        "billing_code",
        "billing_code_type",
        "billing_class",
        "negotiated_type",
        "billing_code_modifier"
      ],
      "title": "ProviderSearchGroupByField",
      "description": "Valid fields for grouping provider search results."
    }
  }
}