It depends what terms and conditions apply to the agreement between you.
If you fail to deliver what has been agreed, or deliver faulty goods, then you have failed to fulfil your side of the contract. In these circumstances, the customer may not be obliged to pay you — or might even be entitled to make a claim for any loss they suffered as a result.
The right terms and conditions will protect you: for example, allowing you to make partial delivery, limiting any liability for faulty goods and so on. As a practical matter, your terms and conditions should require the customer to notify you of any missing or faulty goods within a specified time limit.