Davie, who has no previous convictions, came to police attention after he approached a 14-year-old girl at a library saying he was a talent scout and wanted to take photos of her wearing lingerie for a modelling agency.
Police intercepted him at a later meeting with the girl, and found messages on his phone showing his plans to pay for sex with another child.
The 10-year-old victim's grandmother cannot be named, to protect the identity of the child, who does not know about the offending.
The grandmother began deleting data from her phone while she was being arrested, and had to be physically restrained so police could seize the phone.
The woman, who is a prostitute and knew Davie as a client, began arranging in May 2017 to bring the girl to him so the abuse could be carried out.
The grandmother sent Davie photos she had taken some time earlier of the victim naked in the bath.
Davie paid for a phone top-up for the woman so she would send him the pictures.
Detailed texts between the pair show them discussing payment for the girl, with Davie first offering $1000, and the grandmother then saying she wanted a cheap, reliable car as payment.
At sentencing today, Davie's lawyer, who is also called Andrew Davie, said his client was "upset, sad, sorry, and disgusted" over his offending.
Both accused admitted possessing beastiality material, and Davie also had a written story about incest with children on his computer.
Judge Kelly sentenced Davie to three years and five months in prison, with discounts for such factors as his previous good character and his age. He will also become a registered child sex offender.
She sentenced the grandmother to three years and three months in prison.
Detective Steve Yates, who uncovered the "absolutely vile" plans, said it was "fortuitous" that the teenager who was groomed by Davie "had the wherewithal to notify us of a situation in which she felt uncomfortable".
"Had she not done so, we would not have uncovered the plot to abuse a younger child.
"One frightening aspect of the cause is that a young girl ... could have been offended against and never have been able to disclose it."
Yates said he hoped the sentence would serve as a "stark message" that contemplation and conspiracy to offend, despite the absence of actual offending, would still be seen seriously by the courts.
The sentencing comes several months after that of Auckland woman Kasmeer Lata, who forced her daughter into prostitution in what is only the third slave-dealing case in New Zealand.
Lata received a six-years-and-11-months prison term, while her partner and co-offender Avneensh Sehgal was sentenced to four years and eight months in jail.