Coupon codes
Last updated
Last updated
Loop supports the ability to accept promotion codes created in Stripe at the time of checkout.
Customers can input this code themselves or companies can pass in coupon codes themselves into the widget.
When a customer authorizes payment via the widget or checkout page, they can input a promotion code, Loop will validate this code, and upon checkout, Loop will create or update the customer in Stripe and note the use of the code. Then, when Stripe creates the invoice, it will include the code's discount.
In Stripe, create a coupon in Stripe with a customer facing coupon code.
Loop supports the following functionality for coupon codes:
Customers can apply the coupon code at checkout and Loop will validate if the coupon code works.
Companies can also pass in coupon codes themselves into the widget.
Create coupon codes in Stripe & grab the ID.
You can find directions on how to create codes here.
Once you have created the code, you see it creates an ID - this is the code that you will need to pass to Loop.
Collect payment authorization, passing through the code to Loop
Loop allows you to collect payment authorization either through our widget or checkout page. Currently it is recommended to use the widget and your own custom checkout page.
Company checkout page + Loop widget
You will need to pass the coupon code to the modal upon initialization. You can read how in the modal's NPM package readme. Thus, you will need to provide a way for the customer to input the coupon code and then pass through to Loop.
Please note, the cart will not update to display the discount code. Thus, we recommend that you set cartEnabled: false in the modal (or you can not set the cartEnabled option at all, because false is the default value).
Hosted checkout page
You can use Loop’s checkout page and append the code at the end if the URL. You can use this link to send directly to customers that you are offering the discount to or embed in a link.
https://checkout.loopcrypto.xyz/<entity ID>/<item ID>?coupon=<ID>
Please note, the cart will not update to display the discount code. Thus, we recommend that you hide the cart.
Invoice
After a customer provides authorization, Loop will automatically create that customer in Stripe or update an existing customer. At this time we will tell Stripe that the coupon should be applied. When Stripe generates the invoice, it will include the logic of the coupon and this will be pulled into Loop just like all invoices are.
Supported coupon criteria | Unsupported Coupon |
---|---|
Percentage or fixed amount discount Apply to specific products Forever, once, and multiple months duration
Limit the date range Max redemption: this is set on the promotion code