The story I'm looking for starts with the Apprentice rescuing a girl, who I think is traders daughter. Somehow they fall in love and he has to find a dowry so he goes to a river and magically finds gold which he transforms. Then something happens and the dowry is forfeited, so he enchants carpets to carry goods. I think the girls father becomes a duke, and I'm fairly sure there's a major battle or war towards the ending.