Bed Bath & Beyond is the latest retailer to be hit with a lawsuit over the collection of zip codes from customers. The complaint, filed in US District Court in Boston Wednesday by Melissa Tyler, accuses the home goods chain of violating the state’s consumer privacy laws by collecting the postal information for credit card purchases and then using it to send junk mail to consumers without their permission.

Tyler, a Massachusetts resident, earlier sued the crafts chain Michaels Stores on similar grounds. The state Supreme Judicial Court recently ruled in that case that retailers could not require shoppers to provide zip codes to make credit card purchases.

A spokeswoman for Bed Bath & Beyond, based in New Jersey, said the company had not seen the suit and could not comment.

Tyler is seeking class action status and estimates the “amount in controversy in excess of $5 million,’’ according to the complaint.