You can sell whatever software you develope using ArcGIS API...there is no such restriction of not selling your customizations.
The only thing you need to keep in mind is the licensing.
My reply to a similar forum post could be useful:
http://forums.arcgis.com/threads/30019-Understanding-licensing?p=102363#post102363
Cheers!
You can sell applications using the API only if you have ArcGIS Server License... look at the very end of this post
http://forums.arcgis.com/threads/28815-How-to-display-1-million-points-in-the-Map?p=99092#post99092
so i can sell the code to my client if my client purchases the ArcGIS Server License?