<?xml version="1.0"?>
<!--ESF 3.0.2 multiple payor
[2021-10-25-17-40]-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
<!--Root-->
<xs:element name="esfdoc">
<xs:complexType>
<xs:all>
<xs:element type="xs:dateTime" name="timestamp" minOccurs="0"/>
<xs:element type="billingOrgType" name="billing_org" minOccurs="1"/>
<xs:element type="payorOrgsType" name="payor_orgs" minOccurs="1"/>
<xs:element type="taxesType" name="taxes" minOccurs="0"/>
<xs:element type="extendedFieldsType" name="extended_fields" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
<!--BillingOrg-->
<xs:complexType name="billingOrgType">
<xs:all>
<xs:element type="xs:string" name="name" minOccurs="1"/>
<xs:element type="xs:string" name="source_app" minOccurs="0"/>
<xs:element type="xs:string" name="app_version" minOccurs="0"/>
<xs:element type="xs:string" name="tax_id" minOccurs="1"/>
<xs:element type="xs:string" name="firm_url" minOccurs="0"/>
<xs:element type="addressType" name="address" minOccurs="1" maxOccurs="1"/>
<xs:element type="addressType" name="remit_address" minOccurs="0" maxOccurs="1"/>
<xs:element type="contactType" name="contact" minOccurs="0"/>
<xs:element type="extendedFieldsType" name="extended_fields" minOccurs="0"/>
</xs:all>
<xs:attribute type="xs:string" name="id" use="required"/>
<xs:attribute type="xs:unsignedInt" name="ebilling_id" use="required"/>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<!--PayorOrgs-->
<xs:complexType name="payorOrgsType">
<xs:sequence>
<xs:element type="payorOrgType" name="payor_org" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="payorOrgType">
<xs:all>
<xs:element type="xs:string" name="biller_id" minOccurs="0"/>
<xs:element type="xs:string" name="name" minOccurs="1"/>
<xs:element type="xs:string" name="tax_id" minOccurs="0"/>
<xs:element type="addressType" name="address" minOccurs="0"/>
<xs:element type="invoiceType" name="invoice" minOccurs="1"/>
<xs:element type="contactType" name="contact" minOccurs="0"/>
<xs:element type="extendedFieldsType" name ="extended_fields" minOccurs="0"/>
</xs:all>
<xs:attribute type="string60NoSpace" name="id" use="required"/>
<xs:attribute type="xs:unsignedInt" name="ebilling_id" use="optional"/>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<!--Invoice-->
<xs:complexType name="invoiceType">
<xs:all>
<xs:element type="xs:string" name="date" minOccurs="1"/>
<xs:element type="xs:string" name="due_date" minOccurs="0"/>
<xs:element type="xs:string" name="currency" minOccurs="0"/>
<xs:element type="xs:string" name="start_date" minOccurs="1"/>
<xs:element type="xs:string" name="end_date" minOccurs="1"/>
<xs:element type="xs:string" name="description" minOccurs="0"/>
<xs:element type="xs:string" name="tax_point_date" minOccurs="0"/>
<xs:element type="xs:string" name="tax_invoice" minOccurs="0"/>
<xs:element type="xs:string" name="credit_note" minOccurs="0"/>
<xs:element type="xs:string" name="credit_note_invoice_reference" minOccurs="0"/>
<xs:element type="xs:string" name="payment_terms" minOccurs="0"/>
<xs:element type="xs:string" name="vat_party" minOccurs="0"/>
<xs:element type="xs:string" name="other_iso" minOccurs="0"/>
<xs:element type="regulatoryStatementType" name="regulatory_statement" minOccurs="0"/>
<xs:element type="addressType" name="address" minOccurs="0"/>
<xs:element type="mattersType" name="matters" minOccurs="1" maxOccurs="1">
<xs:unique name="UniqueMatterIdsForEachInvoiceSegment">
<xs:selector xpath="matter"/>
<xs:field xpath="biller_org_matter_id"/>
</xs:unique>
</xs:element>
<xs:element type="invoiceAdjustmentsType" name="adjustments" minOccurs="0" maxOccurs="1"/>
<xs:element type="itemTaxesType" name="item_taxes" minOccurs="0" maxOccurs="1"/>
<xs:element type="extendedFieldsType" name="extended_fields" minOccurs="0" maxOccurs="1"/>
<xs:element type="taxSummariesType" name="tax_summaries" minOccurs="0" maxOccurs="1"/>
</xs:all>
<xs:attribute type="string60NoSpace" name="id" use="required"/>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
<xs:attribute type="xs:boolean" name="has_attachments" use="optional"/>
<xs:attribute type="requestedStatusEnum" name="requested_status" use="optional"/>
<xs:attribute type="xs:string" name="leadmatter" use="optional"/>
</xs:complexType>
<!--Matter-->
<xs:complexType name="mattersType">
<xs:sequence>
<xs:element type="matterType" name="matter" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="matterType">
<xs:all>
<xs:element type="string60" name="payor_org_matter_id" minOccurs="1"/>
<xs:element type="string60" name="biller_org_matter_id" minOccurs="1"/>
<xs:element type="xs:string" name="name" minOccurs="1"/>
<xs:element type="xs:string" name="description" minOccurs="0"/>
<xs:element type="xs:string" name="po_number" minOccurs="0"/>
<xs:element type="xs:string" name="account_type" minOccurs="0"/>
<xs:element type="xs:string" name="matter_type" minOccurs="0"/>
<xs:element type="xs:string" name="matter_open_date" minOccurs="1"/>
<xs:element type="xs:string" name="final_bill" minOccurs="0"/>
<xs:element type="xs:string" name="currency" minOccurs="0"/>
<xs:element type="xs:decimal" name="total_fees" minOccurs="1"/>
<xs:element type="xs:decimal" name="total_expenses" minOccurs="1"/>
<xs:element type="xs:decimal" name="total_fee_adjustment" minOccurs="1"/>
<xs:element type="xs:decimal" name="total_expense_adjustment" minOccurs="1"/>
<xs:element type="xs:decimal" name="percent_fees" minOccurs="0"/>
<xs:element type="xs:decimal" name="percent_expenses" minOccurs="0"/>
<xs:element type="xs:decimal" name="fee_taxes" minOccurs="1"/>
<xs:element type="xs:decimal" name="expense_taxes" minOccurs="1"/>
<xs:element type="xs:decimal" name="net_fees" minOccurs="1"/>
<xs:element type="xs:decimal" name="net_expenses" minOccurs="1"/>
<xs:element type="xs:decimal" name="funds_applied" minOccurs="0"/>
<xs:element type="xs:decimal" name="total_due" minOccurs="1"/>
<xs:element type="contactType" name="contact" minOccurs="0"/>
<xs:element type="typedContactsType" name="contacts" minOccurs="0"/>
<xs:element type="feesType" name="fees" minOccurs="0" maxOccurs="1"/>
<xs:element type="expensesType" name="expenses" minOccurs="0" maxOccurs="1"/>
<xs:element type="timekeepersType" name="timekeepers" minOccurs="0" maxOccurs="1"/>
<xs:element type="matterAdjustmentsType" name="adjustments" minOccurs="0" maxOccurs="1"/>
<xs:element type="extendedFieldsType" name="extended_fields" minOccurs="0" maxOccurs="1"/>
<xs:element type="taxSummariesType" name="tax_summaries" minOccurs="0" maxOccurs="1"/>
</xs:all>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<!--Fees, expenses, timekeepers-->
<xs:complexType name="feesType">
<xs:sequence>
<xs:element type="feeType" name="fee" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="feeType">
<xs:all>
<xs:element type="xs:string" name="charge_date" minOccurs="0"/>
<xs:element type="xs:string" name="timekeeper_id" minOccurs="0"/>
<xs:element type="xs:string" name="timekeeper_level" minOccurs="0"/>
<xs:element type="xs:string" name="work_location_country" minOccurs="0"/>
<xs:element type="xs:string" name="work_location_locality" minOccurs="0"/>
<xs:element type="xs:string" name="charge_description" minOccurs="0"/>
<xs:element type="xs:string" name="task_code" minOccurs="0"/>
<xs:element type="xs:string" name="activity_code" minOccurs="0"/>
<xs:element type="xs:string" name="charge_type" minOccurs="1"/>
<xs:element type="xs:decimal" name="units" minOccurs="1"/>
<xs:element type="xs:decimal" name="rate" minOccurs="1"/>
<xs:element type="xs:decimal" name="base_amount" minOccurs="1"/>
<xs:element type="xs:decimal" name="units_work" minOccurs="0"/>
<xs:element type="xs:decimal" name="rate_work" minOccurs="0"/>
<xs:element type="xs:decimal" name="base_amount_work" minOccurs="0"/>
<xs:element type="xs:decimal" name="item_tax_total" minOccurs="1"/>
<xs:element type="xs:decimal" name="item_adjustment_total" minOccurs="1"/>
<xs:element type="xs:decimal" name="total_amount" minOccurs="1"/>
<xs:element type="feeAdjustmentsType" name="adjustments" minOccurs="0" maxOccurs="1"/>
<xs:element type="itemTaxesType" name="item_taxes" minOccurs="0" maxOccurs="1"/>
<xs:element type="extendedFieldsType" name="extended_fields" minOccurs="0" maxOccurs="1"/>
</xs:all>
<xs:attribute type="xs:string" name="id" use="required"/>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<xs:complexType name="expensesType" mixed="true">
<xs:sequence>
<xs:element type="expenseType" name="expense" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="expenseType">
<xs:all>
<xs:element type="xs:string" name="charge_date" minOccurs="0"/>
<xs:element type="xs:string" name="timekeeper_id" minOccurs="0"/>
<xs:element type="xs:string" name="timekeeper_level" minOccurs="0"/>
<xs:element type="xs:string" name="work_location_country" minOccurs="0"/>
<xs:element type="xs:string" name="work_location_locality" minOccurs="0"/>
<xs:element type="xs:string" name="charge_description" minOccurs="0"/>
<xs:element type="xs:string" name="task_code" minOccurs="0"/>
<xs:element type="xs:string" name="expense_code" minOccurs="0"/>
<xs:element type="xs:string" name="charge_type" minOccurs="1"/>
<xs:element type="xs:decimal" name="units" minOccurs="1"/>
<xs:element type="xs:decimal" name="rate" minOccurs="1"/>
<xs:element type="xs:decimal" name="base_amount" minOccurs="1"/>
<xs:element type="xs:decimal" name="item_tax_total" minOccurs="1"/>
<xs:element type="xs:decimal" name="item_adjustment_total" minOccurs="1"/>
<xs:element type="xs:decimal" name="total_amount" minOccurs="1"/>
<xs:element type="expenseAdjustmentsType" name="adjustments" minOccurs="0"/>
<xs:element type="itemTaxesType" name="item_taxes" minOccurs="0"/>
<xs:element type="extendedFieldsType" name="extended_fields" minOccurs="0"/>
</xs:all>
<xs:attribute type="xs:string" name="id" use="required"/>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<xs:complexType name="timekeepersType" mixed="true">
<xs:sequence>
<xs:element type="timekeeperType" name="timekeeper" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="timekeeperType">
<xs:all>
<xs:element type="xs:string" name="first_name" minOccurs="1"/>
<xs:element type="xs:string" name="last_name" minOccurs="1"/>
<xs:element type="xs:string" name="tkinitials" minOccurs="0"/>
<xs:element type="xs:string" name="level" minOccurs="1"/>
<xs:element type="xs:decimal" name="rate" minOccurs="1"/>
<xs:element type="extendedFieldsType" name="extended_fields" minOccurs="0"/>
</xs:all>
<xs:attribute type="xs:string" name="id" use="required"/>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<!--Adjustments-->
<xs:complexType name="feeAdjustmentsType" mixed="true">
<xs:sequence>
<xs:element type="feeAdjustmentType" name="adjustment" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="feeAdjustmentType">
<xs:all>
<xs:element type="xs:string" name="adjustment_type" minOccurs="1"/>
<xs:element type="xs:string" name="credit_note" minOccurs="0"/>
<xs:element type="xs:string" name="credit_type" minOccurs="0"/>
<xs:element type="xs:string" name="credit_category" minOccurs="0"/>
<xs:element type="xs:string" name="discount_type" minOccurs="0"/>
<xs:element type="xs:string" name="discount_category" minOccurs="0"/>
<xs:element type="xs:string" name="invoice_impact" minOccurs="0"/>
<xs:element type="xs:string" name="split_impact" minOccurs="0"/>
<xs:element type="xs:decimal" name="adjustment_amount" minOccurs="1"/>
<xs:element type="xs:string" name="adjustment_description" minOccurs="0"/>
<xs:element type="itemTaxesType" name="item_taxes" minOccurs="0" maxOccurs="1"/>
</xs:all>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<xs:complexType name="expenseAdjustmentsType" mixed="true">
<xs:sequence>
<xs:element type="expenseAdjustmentType" name="adjustment" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="expenseAdjustmentType">
<xs:all>
<xs:element type="xs:string" name="adjustment_type" minOccurs="1"/>
<xs:element type="xs:string" name="credit_note" minOccurs="0"/>
<xs:element type="xs:string" name="credit_type" minOccurs="0"/>
<xs:element type="xs:string" name="credit_category" minOccurs="0"/>
<xs:element type="xs:string" name="discount_type" minOccurs="0"/>
<xs:element type="xs:string" name="discount_category" minOccurs="0"/>
<xs:element type="xs:string" name="invoice_impact" minOccurs="0"/>
<xs:element type="xs:string" name="split_impact" minOccurs="0"/>
<xs:element type="xs:decimal" name="adjustment_amount" minOccurs="1"/>
<xs:element type="xs:string" name="adjustment_description" minOccurs="0"/>
<xs:element type="itemTaxesType" name="item_taxes" minOccurs="0" maxOccurs="1"/>
</xs:all>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<xs:complexType name="matterAdjustmentsType" mixed="true">
<xs:sequence>
<xs:element type="matterAdjustmentType" name="adjustment" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="matterAdjustmentType">
<xs:all>
<xs:element type="xs:string" name="adjustment_type" minOccurs="1"/>
<xs:element type="xs:string" name="credit_note" minOccurs="0"/>
<xs:element type="xs:string" name="credit_type" minOccurs="0"/>
<xs:element type="xs:string" name="credit_category" minOccurs="0"/>
<xs:element type="xs:string" name="discount_type" minOccurs="0"/>
<xs:element type="xs:string" name="discount_category" minOccurs="0"/>
<xs:element type="xs:string" name="invoice_impact" minOccurs="0"/>
<xs:element type="xs:string" name="split_impact" minOccurs="0"/>
<xs:element type="xs:decimal" name="adjustment_amount" minOccurs="1"/>
<xs:element type="xs:decimal" name="item_tax_total" minOccurs="1"/>
<xs:element type="xs:string" name="adjustment_description" minOccurs="0"/>
<xs:element type="itemTaxesType" name="item_taxes" minOccurs="0" maxOccurs="1"/>
</xs:all>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<xs:complexType name="invoiceAdjustmentsType" mixed="true">
<xs:sequence>
<xs:element type="invoiceAdjustmentType" name="adjustment" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="invoiceAdjustmentType">
<xs:all>
<xs:element type="xs:string" name="adjustment_type" minOccurs="1"/>
<xs:element type="xs:string" name="credit_note" minOccurs="0"/>
<xs:element type="xs:string" name="credit_type" minOccurs="0"/>
<xs:element type="xs:string" name="credit_category" minOccurs="0"/>
<xs:element type="xs:string" name="discount_type" minOccurs="0"/>
<xs:element type="xs:string" name="discount_category" minOccurs="0"/>
<xs:element type="xs:string" name="invoice_impact" minOccurs="0"/>
<xs:element type="xs:string" name="split_impact" minOccurs="0"/>
<xs:element type="xs:decimal" name="adjustment_amount" minOccurs="1"/>
<xs:element type="xs:string" name="adjustment_description" minOccurs="0"/>
<xs:element type="itemTaxesType" name="item_taxes" minOccurs="0" maxOccurs="1"/>
</xs:all>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<!--Taxes-->
<xs:complexType name="taxesType" mixed="true">
<xs:sequence>
<xs:element type="taxType" name="tax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="taxType">
<xs:all>
<xs:element type="xs:string" name="tax_id_number" minOccurs="0"/>
<xs:element type="xs:string" name="name" minOccurs="0"/>
<xs:element type="xs:string" name="description" minOccurs="0"/>
<xs:element type="xs:string" name="type" minOccurs="1"/>
<xs:element type="xs:decimal" name="percent_rate" minOccurs="1"/>
<xs:element type="xs:string" name="jurisdiction_country" minOccurs="0"/>
<xs:element type="xs:string" name="jurisdiction_locality" minOccurs="0"/>
<xs:element type="boolType" name="tax_on_tax" minOccurs="0"/>
<xs:element type="xs:string" name="tax_on_tax_id" minOccurs="0"/>
<xs:element type="xs:string" name="invoice_impact" minOccurs="0"/>
</xs:all>
<xs:attribute type="xs:string" name="id" use="required"/>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<xs:complexType name="taxSummariesType" mixed="true">
<xs:sequence>
<xs:element type="taxSummaryType" name="tax_summary" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="taxSummaryType">
<xs:all>
<xs:element type="xs:decimal" name="taxable_fees" minOccurs="0"/>
<xs:element type="xs:decimal" name="total_fee_taxes" minOccurs="0"/>
<xs:element type="xs:decimal" name="taxable_expenses" minOccurs="0"/>
<xs:element type="xs:decimal" name="total_expense_taxes" minOccurs="0"/>
</xs:all>
<xs:attribute type="xs:string" name="tax_id" use="required"/>
<xs:attribute type="xs:string" name="tax_id_number" use="optional"/>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<xs:complexType name="itemTaxesType">
<xs:sequence>
<xs:element type="itemTaxType" name="item_tax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="itemTaxType">
<xs:attribute type="xs:string" name="tax_id" use="required"/>
<xs:attribute type="xs:string" name="tax_id_number" use="optional"/>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<!--Contacts and addresses-->
<xs:complexType name="typedContactsType">
<xs:sequence>
<xs:element type="typedContactType" name="contact" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="typedContactType">
<xs:all>
<xs:element type="contactTypeEnum" name="type" minOccurs="1"/>
<xs:element type="xs:string" name="first_name" minOccurs="0"/>
<xs:element type="xs:string" name="last_name" minOccurs="0"/>
<xs:element type="xs:string" name="phone" minOccurs="0"/>
<xs:element type="xs:string" name="fax" minOccurs="0"/>
<xs:element type="xs:string" name="email" minOccurs="0"/>
</xs:all>
<xs:attribute type="xs:string" name="id" use="required"/>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<xs:complexType name="contactType">
<xs:all>
<xs:element type="xs:string" name="first_name" minOccurs="0"/>
<xs:element type="xs:string" name="last_name" minOccurs="0"/>
<xs:element type="xs:string" name="phone" minOccurs="0"/>
<xs:element type="xs:string" name="fax" minOccurs="0"/>
<xs:element type="xs:string" name="email" minOccurs="0"/>
</xs:all>
<xs:attribute type="xs:string" name="id" use="required"/>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<xs:complexType name="addressType">
<xs:all>
<xs:element type="xs:string" name="address_1" minOccurs="1"/>
<xs:element type="xs:string" name="address_2" minOccurs="0"/>
<xs:element type="xs:string" name="address_3" minOccurs="0"/>
<xs:element type="xs:string" name="city" minOccurs="0"/>
<xs:element type="xs:string" name="state_province" minOccurs="0"/>
<xs:element type="xs:string" name="zip_postal_code" minOccurs="0"/>
<xs:element type="xs:string" name="country" minOccurs="0"/>
<xs:element type="xs:string" name="phone" minOccurs="0"/>
<xs:element type="xs:string" name="fax" minOccurs="0"/>
</xs:all>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<!--Other-->
<xs:complexType name="regulatoryStatementType">
<xs:all>
<xs:element type="xs:string" name="regulation_heading" minOccurs="0"/>
<xs:element type="xs:string" name="regulatory_statement" minOccurs="0"/>
</xs:all>
<xs:attribute type="xs:string" name="node_id" use="optional"/>
</xs:complexType>
<xs:complexType name="extendedFieldsType" mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:any minOccurs="0" processContents="skip"/>
</xs:choice>
<xs:attribute type="xs:string" name="node_id"/>
</xs:complexType>
<!--Enumerations-->
<xs:simpleType name="contactTypeEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="lfManaging"/>
<xs:enumeration value="lf"/>
<xs:enumeration value="cl"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="requestedStatusEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="hold"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
<!--String types-->
<xs:simpleType name="stringNoSpace">
<xs:restriction base="xs:string">
<xs:pattern value=".*[^\s].*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="string60">
<xs:restriction base="xs:string">
<xs:maxLength value="60"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="string60NoSpace">
<xs:restriction base="string60">
<xs:pattern value=".*[^\s].*"/>
</xs:restriction>
</xs:simpleType>
<!--Other types-->
<xs:simpleType name="boolType">
<xs:restriction base="xs:string">
<xs:enumeration value="True"/>
<xs:enumeration value="False"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>