As long as you get minimum wage for all hours worked, the employer can create any kind of bonus structure is wishes to create. There is nothing unlawful about a bonus plan that pays based on the money actually realized by the employer as opposed to a pre-discount or pre-coupon amount.
Good luck to you.
This answer should not be construed to create any attorney-client relationship. Such a relationship can be formed only through the mutual execution of an attorney-client agreement. The answer given is based on the extremely limited facts provided and the proper course of action might change significantly with the introduction of other facts. All who read this answer should not rely on the answer to govern their conduct. Please seek the advice of competent counsel after disclosing all facts to that attorney. This answer is intended for California residents only. The answering party is only licensed to practice in the State of California.
As Mr. Pederson states, so long as you are receiving minimum wage, your commission arrangement is part of your contract with your employer. If he made known to you before you started work that he calculated your commission based on the discounted value of your sales, the arrangement is legal.