Under the Uniform Commercial Code, adopted in American state law, a buyer may refuse a delivery that does not match the contract. If the goods “fail in any respect to conform to the contract,” the buyer may reject the whole delivery, accept the whole delivery, or accept some commercial units and reject the rest.
Lawyers call this the perfect tender rule. In practice it is limited by other rules, for example for deliveries in installments and for limits on remedies written into the contract.