I ran into the same issue, so I did some tests and it appears as if &avoid=tolls|highways
is the correct usage.
Going from Portland, OR to San Francisco, CA has tolls and highways. If you go to maps.google.com and route between the two, selecting different options, you find that Google gives you the same route for avoiding highways as avoiding highways and tolls.
When doing an API request &avoid=tolls|highways
results in the same as &avoid=highways|tolls
.
&avoid=tolls,highways
results in not avoiding either.
&avoid=tolls&avoid=highways
results in only avoiding tolls.
This all leads me to infer that Google must be reading both variables when you pass them with a |
. however, avoiding tolls and highways often results in the same directions as just avoiding highways.