SAN FRANCISCO – California merchants may not ask customers who pay with credit cards for their ZIP codes, the California Supreme Court decided unanimously Thursday.

In a case closely watched by retailers, the state high court said ZIP codes were “personal identification information,” which a state law bars businesses from demanding of customers.

The class-action lawsuit against Williams-Sonoma Stores Inc. was brought by a woman who contended that Williams-Sonoma asked her for her ZIP code when she purchased an item with her credit card.

She said the store used her name and ZIP code to identify her address and then stored the information in a database for marketing. She also contended the store had the ability to sell her information to other businesses.

Two lower courts rejected the suit, but the California Supreme Court said a ZIP code was part of a person’s address and therefore covered by the state’s Credit Card Act.