Spoiler alert: this is the exact template I use for my own affiliate program with the Creative Law Shop®. It details exactly what is expected of both parties, payment and duration terms, and more.
This template was designed to protect both your business and the affiliate; laying out all terms so that both parties are completely clear on what is expected from the relationship.