{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/collectly/json-schema/collectly-snapshot-partner-schema.json",
  "title": "SnapshotPartner",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/collectly-statements-api-openapi.yml#/components/schemas/SnapshotPartner",
  "properties": {
    "allowed_amount": {
      "readOnly": true,
      "type": [
        "number",
        "null"
      ]
    },
    "billed_amount": {
      "readOnly": true,
      "type": [
        "number",
        "null"
      ]
    },
    "created_at": {
      "readOnly": true
    },
    "data": {
      "allOf": [
        {
          "$ref": "#/$defs/SnapshotData"
        }
      ],
      "default": {
        "visits": []
      }
    },
    "id": {
      "format": "int32",
      "readOnly": true,
      "type": "integer"
    },
    "ins_paid": {
      "readOnly": true,
      "type": [
        "number",
        "null"
      ]
    },
    "modified_at": {
      "readOnly": true
    },
    "patient_id": {
      "readOnly": true,
      "type": "string"
    },
    "practice_id": {
      "type": "string"
    },
    "pt_amount": {
      "readOnly": true,
      "type": "number"
    },
    "pt_balance": {
      "readOnly": true,
      "type": "number"
    }
  },
  "required": [
    "practice_id"
  ],
  "type": "object",
  "$defs": {
    "Adjustment": {
      "properties": {
        "amount": {
          "type": "number"
        },
        "group": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        }
      },
      "required": [
        "amount",
        "group",
        "reason"
      ],
      "type": "object"
    },
    "Discount": {
      "properties": {
        "amount": {
          "type": [
            "number",
            "null"
          ]
        },
        "description": {
          "type": "string"
        },
        "external_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "valid_until": {
          "format": "date",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "ERALineItem": {
      "properties": {
        "adjustments": {
          "items": {
            "$ref": "#/$defs/Adjustment"
          },
          "type": "array"
        },
        "allowed": {
          "type": [
            "number",
            "null"
          ]
        },
        "billed": {
          "type": "number"
        },
        "paid": {
          "type": "number"
        },
        "remark": {
          "type": [
            "string",
            "null"
          ]
        },
        "service_code": {
          "type": "string"
        },
        "service_date_end": {
          "format": "date",
          "type": [
            "string",
            "null"
          ]
        },
        "service_date_start": {
          "format": "date",
          "type": [
            "string",
            "null"
          ]
        },
        "units": {
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "billed",
        "paid",
        "service_code"
      ],
      "type": "object"
    },
    "InsurancePayment": {
      "properties": {
        "adjustment": {
          "type": [
            "number",
            "null"
          ]
        },
        "allowed_amount": {
          "type": [
            "number",
            "null"
          ]
        },
        "coins_amount": {
          "type": [
            "number",
            "null"
          ]
        },
        "company_external_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "date": {
          "format": "date",
          "type": [
            "string",
            "null"
          ]
        },
        "deduct_amount": {
          "type": [
            "number",
            "null"
          ]
        },
        "external_id": {
          "type": "string"
        },
        "extra": {
          "type": [
            "object",
            "null"
          ]
        },
        "ins_paid": {
          "type": [
            "number",
            "null"
          ]
        },
        "member_balance": {
          "type": [
            "number",
            "null"
          ]
        },
        "withheld_amount": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "InsurancePolicyState": {
      "properties": {
        "claim_adjustments": {
          "items": {
            "$ref": "#/$defs/Adjustment"
          },
          "type": "array"
        },
        "claim_status": {
          "type": "string"
        },
        "claim_status_description": {
          "type": "string"
        },
        "codes_description": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "line_items": {
          "items": {
            "$ref": "#/$defs/ERALineItem"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "SnapshotAppointment": {
      "properties": {
        "external_id": {
          "type": "string"
        },
        "id": {
          "format": "int32",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "SnapshotData": {
      "properties": {
        "balance_past_120_days": {
          "type": [
            "number",
            "null"
          ]
        },
        "payments": {
          "items": {
            "$ref": "#/$defs/SnapshotPayment"
          },
          "type": "array"
        },
        "visits": {
          "items": {
            "$ref": "#/$defs/SnapshotVisit"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "SnapshotLocation": {
      "properties": {
        "data": {
          "type": "object"
        },
        "external_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "tax_id": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "SnapshotPayment": {
      "properties": {
        "allocations": {
          "items": {
            "$ref": "#/$defs/SnapshotPaymentAllocation"
          },
          "type": "array"
        },
        "amount": {
          "type": "number"
        },
        "collectly_id": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "payment_type": {
          "enum": [
            "payment",
            "copay",
            "refund",
            "part_ref",
            "autodeb",
            "collect"
          ],
          "type": "string"
        },
        "post_date": {
          "description": "ISO-8601 date format",
          "format": "date",
          "type": "string"
        },
        "source_payment_id": {
          "type": "string"
        }
      },
      "required": [
        "amount",
        "id"
      ],
      "type": "object"
    },
    "SnapshotPaymentAllocation": {
      "properties": {
        "amount": {
          "type": "number"
        },
        "charge_id": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "visit_id": {
          "type": "string"
        }
      },
      "required": [
        "amount",
        "id"
      ],
      "type": "object"
    },
    "SnapshotVisit": {
      "properties": {
        "adjustment": {
          "readOnly": true
        },
        "allowed_amount": {
          "type": "number"
        },
        "appointment": {
          "allOf": [
            {
              "$ref": "#/$defs/SnapshotAppointment"
            }
          ]
        },
        "billed_amount": {
          "type": "number"
        },
        "billing_hold_reason": {
          "enum": [
            "not_billable_financial_class",
            "active_subscription_cycle",
            "bad_debt",
            "candid_excluded_payer",
            "excluded_cpt_code",
            "excluded_tag"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "billing_hold_type": {
          "enum": [
            "pending",
            "archived",
            "disabled_location",
            "disabled_provider",
            "written_off"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "billing_location": {
          "$ref": "#/$defs/SnapshotLocation"
        },
        "billing_provider": {
          "$ref": "#/$defs/VisitProvider"
        },
        "charges": {
          "items": {
            "$ref": "#/$defs/SnapshotVisitCharge"
          },
          "type": "array"
        },
        "collections_status": {
          "type": [
            "string",
            "null"
          ]
        },
        "discounts": {
          "items": {
            "$ref": "#/$defs/Discount"
          },
          "type": "array"
        },
        "ehr_discounts": {
          "items": {
            "$ref": "#/$defs/Discount"
          },
          "type": "array"
        },
        "external_id": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "ins_paid": {
          "type": "number"
        },
        "insurance_payments": {
          "items": {
            "$ref": "#/$defs/InsurancePayment"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "insurance_policies": {
          "items": {
            "$ref": "#/$defs/VisitInsurancePolicy"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "location": {
          "$ref": "#/$defs/_Location"
        },
        "location_id": {
          "type": [
            "string",
            "null"
          ],
          "writeOnly": true
        },
        "meta": {},
        "notes": {
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "patient_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "provider": {
          "$ref": "#/$defs/_Provider"
        },
        "provider_id": {
          "type": [
            "string",
            "null"
          ],
          "writeOnly": true
        },
        "pt_adjustment": {
          "type": "number"
        },
        "pt_amount": {
          "type": "number"
        },
        "pt_bad_debt": {
          "type": [
            "number",
            "null"
          ]
        },
        "pt_balance": {
          "type": "number"
        },
        "pt_balance_on_hold": {
          "type": "number"
        },
        "pt_paid": {
          "type": "number"
        },
        "raw_adjustments": {
          "items": {
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "service_date": {
          "format": "date",
          "type": "string"
        },
        "visit_pt_adjustment": {
          "type": "number"
        }
      },
      "required": [
        "id",
        "location_id",
        "provider_id",
        "service_date"
      ],
      "type": "object"
    },
    "SnapshotVisitCharge": {
      "properties": {
        "adjustment": {
          "readOnly": true
        },
        "allowed_amount": {
          "type": [
            "number",
            "null"
          ]
        },
        "billed_amount": {
          "type": [
            "number",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "type": "string"
        },
        "ins_paid": {
          "type": [
            "number",
            "null"
          ]
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        },
        "procedure_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "pt_adjustment": {
          "type": [
            "number",
            "null"
          ]
        },
        "pt_amount": {
          "type": [
            "number",
            "null"
          ]
        },
        "pt_balance": {
          "type": [
            "number",
            "null"
          ]
        },
        "pt_paid": {
          "type": [
            "number",
            "null"
          ]
        },
        "rx_number": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "VisitInsurancePolicy": {
      "properties": {
        "company_external_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "group_id": {
          "type": "string"
        },
        "insurance_name": {
          "type": "string"
        },
        "member_id": {
          "type": "string"
        },
        "policy_external_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "priority": {
          "enum": [
            "primary",
            "secondary",
            "tertiary",
            "other"
          ],
          "type": "string"
        },
        "state": {
          "allOf": [
            {
              "$ref": "#/$defs/InsurancePolicyState"
            }
          ],
          "readOnly": true
        }
      },
      "type": "object"
    },
    "VisitProvider": {
      "properties": {
        "display_name": {
          "type": "string"
        },
        "external_id": {
          "type": "string"
        },
        "first_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "last_name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "_Location": {
      "properties": {
        "collectly_id": {
          "readOnly": true,
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "_Provider": {
      "properties": {
        "collectly_id": {
          "readOnly": true,
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    }
  }
}