extract order function to post method