The near-resonant flow of a fluid over a localized topography is examined. The flow is considered in the weakly nonlinear long-wave limit and is governed by the forced Korteweg-de Vries (fKdV) equation at first order. It is shown that the unidirectional assumption, of right-moving waves only, is incompatible with mass conservation at second order. To resolve this incompatibility, a forced coupled KdV system, which allows left-moving waves, is derived to third order (two orders beyond the fKdV approximation). The second-order fKdV equation is reformulated as an asymptotically equivalent forced Benjamin-Bona-Mahony (fBBM) equation, as its numerical scheme has superior stability. First- and second-order predictions for the resonant flow of surface water waves are compared and the mass flux between the right- and left-moving waves is found. An analytical estimate for the mass flux between the right- and left-moving waves is also derived and good agreement with the numerical solution is obtained. © 1999 American Institute of Physics.