old_Loopcrypto.xyz
  • Introduction
  • Supported networks and tokens
  • Loop + Frames
  • Learn
    • How Loop works
    • Core components
      • Collecting authorization
        • Enabling payment on multiple networks
        • Accepting ETH and MATIC
      • Sending payment requests
      • Checking a customer's balance & allowance
      • Receipts and reminders
      • Customer portal
    • Loop + your financial stack
      • Linking on-chain transactions with invoices in your ERP system
      • Connecting with accounting software
      • Crypto off-ramp
    • Case studies
  • Dashboard functionality
    • Subscriptions
      • Free trials, discounts and more
      • Auto-invoicing
      • Auto-cancelations
    • One-time payments
    • Scheduling outbound payments
      • Internal notes
    • Editing an upcoming payment
    • Payments for platforms
  • Integrations
    • Stripe + Loop
      • Getting setup
      • Stripe Connect setup
      • Subscriptions
        • Free trials
        • Upgrading a customer or editing a subscription's products
      • Invoicing
      • One-time payments
      • Coupon codes
      • Stripe Connect - Subscriptions
      • FAQs about Stripe integration
    • Chargebee + Loop
      • Getting setup
      • Subscriptions
      • One-time payments
      • Coupon codes
    • Quickbooks + Loop
      • Invoicing
    • Xero + Loop
      • Invoicing
    • Ghost.org + Loop
    • Zapier + Loop
    • Manually add integrations
  • Technical Docs
    • APIs
      • Entity
        • Adding child entities
        • Adding user to child entity
        • Get child entities
      • Items
        • Adding items
          • Item types
          • Categories
        • Retrieving an item
        • Updating an item
        • Deactivating an item
      • Agreements
      • Transfer requests
        • Signing transfer requests
        • Loop CLI
        • Canceling transfer requests
        • Transfer request status
        • Handling unfulfilled transfer requests
        • Validations
      • Webhooks
        • Checking webhook signatures
        • Demo App
        • Slack, Airtable, Discord, Telegram
    • Archeticture
      • Smart contract
        • Deploying your smart contract
          • Modifying smart contract properties
      • Collecting authorization
        • Checkout page
          • Additional functionality
          • Add "pay with crypto" button
        • Checkout widget
          • NPM package readme
        • Checkout parameter examples
      • Providing on-chain payment based access
        • Subscription gated communities
    • Loop SDK
      • Verify Webhook
      • Transfers
      • Error Handling
      • Generating API keys
    • Sample guide: Collect a subscription or one-time payment
    • Integrating the Loop Protocol into your dApp
      • Payroll applications
      • Loan platforms (credit cards, BNPL)
    • Security
      • API Authentication
      • Securing with signatures
      • API Trust assumptions
      • Audits
  • FAQs
  • Company Dashboard
  • Loop Portal
Powered by GitBook
On this page
  1. Integrations
  2. Chargebee + Loop

Coupon codes

PreviousOne-time paymentsNextQuickbooks + Loop

Last updated 11 months ago

Loop supports the ability to pass external coupon codes for Chargebee to Loop at the time of checkout, which will then be applied to the Chargebee plan object when checkout is completed.

When a customer authorizes payment via the modal or checkout page, Loop will create or update the customer in Chargebee and note the use of the coupon code. Then, when Chargebee creates the invoice, it will include such a code.

This functionality is in alpha, thus there are a few important considerations to note:

  • We currently do not validate the coupon codes. Thus, you may want to add validation on your end. Using an incorrect code will result in the end-user not being able to provide authorization via Loop.

Below we outline the steps to using coupon codes and offer suggestions on the best configuration.

Steps:

  1. Create coupon codes in Chargebee & grab the ID.

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 modal or hosted checkout page. Currently it is recommended to use the modal and your own custom checkout page.

Company checkout page + Loop modal

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 (coupon code passed via URL)

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=<couponID>

Please note, we are not validating the code and it will not be reflected on the cart on the checkout page, and if shown for the modal, at this time. Thus, if the code or ID is incorrect, the subscription creation will fail. Thus, we recommend that you add in the price metadata a description noting the discount.

Hosted checkout page (coupon code entered in cart)

If you've generated a coupon code in Chargebee and shared it with your customers, they can also input that code directly into Loop's checkout cart for the discount to be applied. Once the code is added, the customer will see the amount due update as shown below. After the customer completes the checkout, they will be billed the discounted amount as per the logic of the Chargebee coupon.

Invoice

After a customer provides authorization, Loop will automatically create that customer in Chargebee or update an existing customer. At this time, we will tell Chargebee that the coupon should be applied. When Chargebee generates the invoice, it will include the logic of the coupon and this will be pulled into Loop just like all invoices are.