This movie is based on a book by Ben Stein of Ferris Bueller's Day Off (1986) fame. The book, published in 1983, is titled "'Ludes: A Ballad of the Drug and the Dream" and is about the abuse of Quaaludes (methaqualone) rather than cocaine as in the movie. Supposedly based on a friend of Stein's who met his ruin through the abuse of Quaaludes in the 70's and 80's, the action in the movie follows almost exactly the action of the book, even down to some of the dialogue.
The first shot of the movie was actually the last one filmed; it is also the only shot actually filmed in New York City. The rest of the movie's NYC scenes were filmed in Los Angeles because the crew was on such a tight budget.
All the scenes set in Mexico were actually filmed in Venice, California; the crew was unable to travel to Mexico, again because of the movie's low budget.