The concept of watershed ecological compensation is one payment for ecosystem services (PES) program that incentivizes stakeholders undertake environmental conservation activities that improve the provision of ecosystem services. Defining the heterogeneity of farmers’ willingness to participate in watershed ecological compensation is critically important for fully understanding stakeholders’ demands. Accordingly, we designed a choice experiment survey to analyze the heterogeneity of policy preferences and willingness to receive compensation between upstream and midstream farmers in Xin’an River basin, China. Moreover, we simulated the impact of farmers’ social capitals’ heterogeneity with an agent-based model. The results show that there are significant differences in the preferences of agricultural waste recycling rate and agricultural water quality between farmers in the upstream and midstream. The total willingness of farmers in the upstream and midstream to participate in ecological compensation are RMB 149.88 (USD 22.54)/month and RMB 57.40 yuan (USD 8.63)/month, respectively. Social network size has a negative effect on farmers’ willingness to participate the programs. Our findings suggest that the characteristics of farmers’ influence their willingness to participate in the PES program. The results of this research can be used to improve PES management policies in the future, as well as to support sustainable environmental development and rural revitalization.