The Canadian publishers of the new Harry Potter book have secured a gag order preventing leaks after a "small number" of copies were mistakenly sold.
There is a strict embargo on sales of Potter books
Raincoast Books were granted the court injunction after a store near Vancouver put the book on sale early.
The order prevents anyone disclosing all or part of the plot to Harry Potter and the Half-Blood Prince ahead of its worldwide release on 16 July.
Those returning the book will be rewarded with a JK Rowling autograph.
The company, which both publishes and distributes the books in Canada, sought the injunction in the Supreme Court of British Columbia.
"Raincoast have promised fans of Harry Potter that we would do our best to ensure that they would be the first to discover the secrets contained within Harry Potter and the Half-Blood Prince," said Jamie Broadhurst, marketing director at Raincoast Books.
"We felt that we had to take all necessary legal action to keep our promise to Canadian fans."
The book was put on sale in one shop on 7 July before it was quickly removed.
"It is not the intention of Raincoast to penalise the small group of fans who have innocently purchased a book in good faith," said Mr Broadhurst.
"We look to them to ensure that the excitement and mystery of the story is preserved for fans around the world until 16 July by co-operating with us and observing the terms of the court injunction."
Raincoast said any books returned would be held until 0001 on 16 July and returned with a signed bookplate and limited edition T-shirt.
In 2003 Rowling sued a US newspaper for revealing plot details after a couple managed to buy Harry Potter and the Order of the Phoenix from a store in Brooklyn before its release date.