Coupon codes

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.


Creating coupon codes

In Stripe, create a coupon in Stripe with a customer facing coupon code.

Supported coupon criteriaUnsupported Coupon

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.


Passing in coupon codes to the checkout

Companies can also pass in coupon codes themselves into the widget.

  1. 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.

  1. 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.

  1. 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.

Last updated