Digital platforms that connect smallholder farmers with intermediaries offer a promising path to first-mile traceability and improved livelihoods. Yet such platforms face several challenges. Full disintermediation is often impossible because intermediaries are essential for logistics and deeply embedded in local informal relationship networks; stability is fragile, as farmers and intermediaries may revert to trading through local informal networks if they derive insufficient value on the platform; profit margins are tight; and operations are complex due to fragmentation, scale, heterogeneity, and significant uncertainty about local informal networks. To address these challenges, we develop a flexible model of the platform's joint decisions-matching farmers to intermediaries and setting payments-that captures potential off-platform deviations via local informal networks and enforces stability constraints that preclude them. Deviations are modeled with ambiguity sets that capture the platform's imperfect information and the breadth of intermediaries' relationship networks. We prove structural results and, leveraging them, design exact and approximate branch-and-bound algorithms. We pair a case study based on real data from Indonesia's palm-oil supply chain with a stylized version of the model that we solve analytically, to derive insights regarding the platform's main decisions. Our findings yield several managerial implications. Profitability depends critically on reducing transportation costs and obtaining at least partial data on informal local networks. Payments should be directed primarily to farmers; surprisingly, if intermediaries have larger relationship networks, platforms should increase payments to farmers and decrease payments to intermediaries, which is the most cost-effective way to ensure stability. In dealing with heterogeneous intermediaries, platforms should use efficient (i.e., minimum-cost) matchings unless some intermediaries have extremely large informal relationship networks, in which case they must be prioritized to ensure stability, despite a loss in efficiency.