building merchant function