Cardiff have been chasing Madine throughout this month's transfer window and saw their opening two bids rejected by Bolton.
However, with the transfer window set to close on Wednesday Cardiff have come back with an improved offer which could rise to £6million and Bolton have reluctantly accepted it.
Bolton boss Phil Parkinson was keen to keep hold of top scorer Madine, but the offer was too good to turn down and Bolton are now ready to use some of the funds to bring in a replacement.
Madine has scored 10 goals from 28 appearances in the Championship, including one in the win over Cardiff earlier this season.
Having started his career at Carlisle, Madine spent four years at Sheffield Wednesday before joining Bolton in 2015, and he helped them win promotion back to the Championship last season.
Cardiff boss Neil Warnock sees Madine as someone who can score the goals to boost his side's chances of winning promotion to the Premier League.