Please go to the backend of Shopify -> Discounts -> Create a Discount Code.

Then it should now then work when your customer apply it on the Checkout Page.

Did this answer your question?