No, it is not legal: one party to a transaction may not unilaterally (without the other party's consent) take credits or otherwise reduce what they will pay. Legally, you can them for breach of contract (for the violating the terms of the sale, whether those terms were written, oral, or a mixture of both) for the money. Of course, whether it's worth suing them depends on how good a customer they are otherwise, since if you sue them, you will likely lose them as a customer. If they do $40k business with you a year, but take $10k+ in credits, likely seriously impacting your bottom line, you probably don't want them and should likely sue for the money to which you are entitled. But if they do $200k+ per year and take $10k, or 5%, in credits, you might chalk this up as being a cost doing business, equivalent to if they negotiated a 5% or so discount.