Where did the "trick" in the phrase "turning tricks" come from?

Solution 1:

I've got a possible interpretation, for which however, I'm afraid there is actually little hard evidence (but considering the scarcity of etymology studies dealing with prostitution professional vocabulary, this is hardly surprising). However if you connect the dots, it kind of makes sense.

For each dot, in the conjecture below, I will add a confidence level (abbreviated as CL), so that hopefully other contributors might fill the gaps.

Here it goes anyway:

It all comes from... Surprise, surprise.... French argot (slung).

  1. "trique" in popular French is a word for a wooden stick (CL 100%). French donkey's are sometimes motivated using "des coups de trique". It is believed to come from Northern French dialectal "estrique" and is akin to "strike" in English, "streik" in German and so on. Also gives "tricoter" (to knit) in French.
  2. "avoir la trique" or "triquer" means to have an erection (CL 100%).
    Passing the boundary between popular and argotic here.
  3. By extension "triquer" or "trequer" means, for a man to make love, in a careless/bestial way to his partner. (CL 100%). Please refer to a famous novel named "Prostitution" by Pierre Guyotat, easy to find on the web. Just Google for "Guyotat triquer" and you should net a large number of hits.
  4. The verb "triquer" used as "to have sex with a prostitute" was particularly common in the world of French prostitution in the previous century at least (CL 50%). Can't back this from personal experience, I'm afraid ;-).
  5. The idiomatic expression passes in the English language somehow (CL 20%).
  6. A trick in English in the context of prostitution has both the meaning of a customer or the act itself. (CL 100%).
  7. To "turn tricks" is to engage in acts of prostitution with "Johns" or "Tricks".

So you see, this is a possibility but there are a few gaps which I'm not able to fill with certainty.

Edit
Since this post was composed (more than one year ago) and as I researched the world of the French Impressionists, I came across additional info concerning the step in which the expression passes into English.
It is a well documented fact that the French industrial revolution was accompanied as everywhere else, by rural exodus, poverty, and an increase in the levels of urban prostitution. It is also possible to show that a proportion of French prostitutes emigrated to the US and various other destinations (even Australia) at that time (end of the 19th Century). Conversely, one can find examples of "petits femmes de Paris" having risen to a certain level of fame and wealth in the US at the time.
In summary, the possibility that the expression passes into English now seems less conjectural to me.

Solution 2:

Etymonline says "trick" meaning a protitute's client or the act of performing prostitution came from American slang for "robbery":

Meaning "prostitute's client" is first attested 1915; earlier it was U.S. slang for "a robbery" (1865).

In the late 19th and early 20th century in America, prostitutes often teamed up with thugs to rob their patrons. It is possibly this association that caused the commingling and later transfer of meaning.