Stripe Connect - Subscriptions

Platforms can use Loop + Stipe Connect to have the ability to manage subscriptions on their platform, but also offer creators the ability to configure their own subscriptions (self serve), and the integration between Loop and Stripe means that creators can collect crypto payments for those subscriptions, which is more scalable than if the company always has to manage creators' subscriptions. Additionally, creator platforms can automatically collect platform fees for creator subscriptions.

Below are directions on how to use Stripe with connected accounts as your subscription management platform and thus leverage Stripe connected account features while accepting crypto payments for your creator platform or marketplace.

Overview

Considerations

  • Loop child accounts, which correspond to Stripe connected accounts, can only view and manage products, and transactions for their own account on Loop's dashboard. By default, accounts are created as "view only" but can be modified to manage products. Contact Loop to modify this.

  • Loop parent accounts can view and manage products, agreements, and transactions for their own plus any child accounts

  • Loop works with both recurring and one-time pricing.

  • Price descriptions set up in Stripe will NOT be brought over to Loop, however, you can add descriptions manually in Loop by editing the item

  • Loop currently does not support Net Pay days, i.e. payment being due X number of days after invoice is sent. Payment must be due immediately.

Steps

1. Get setup using the automated setup

Get setup by providing Loop with a Stripe API key and configuring child entities for connected accounts. A setup guide specifically for connected accounts can be found here. Your setup will map connected accounts in Stripe to child entities in Loop, as shown below:

Configuring platform fees

Creator platforms and marketplaces can also optionally configure a platform fee to automatically be charged for any child entity payments. The fee can be configured as a percentage (ex. 5%) or a fixed amount (ex. $0.50 USD). Different platform fee amounts can be configured for each child entity, or a single platform fee amount can be configured for all child entities.

When transfer requests are created for child entities, if a platform fee has been configured, two transfers (one for the platform fee, and one for the remaining amount) will be created, and they will be processed in an all-or-nothing fashion. In other words, if the end user has insufficient allowance or balance for both of these transfers to be processed, then neither of the transfers will be processed, and the end user will be prompted to increase their allowance or balance via an email notification.

2. Add a product in Stripe

At integration, Loop will pull in any products already configured at both the parent and child entity levels (your connected accounts). Going forward, as products are made in Stripe for either the main account or the connected accounts, they will automatically be created in Loop. You can see how to add products in Stripe here.

3. Edit which tokens and networks you want to accept

By default, any product brought in from Stripe will have all tokens saved in the parent entity’s contract enabled. If you would like to limit the tokens, you will need to edit the item's accepted tokens list. Here are directions.

4. Provide a method for collecting authorization

Companies have two ways to collect authorization for subscriptions, via the hosted checkout page or the checkout modal.

By default, Loop collects emails which companies can use as an identifier to link to the customer ID in their system or companies can also choose to pass through an external reference ID. Additional information about reference IDs in checkout can be found here.

Checkout page

Loop provides a custom checkout page for each subscription item. This page can be sent directly to the end customer via email, telegram, or an externally generated invoice, or it can be embedded directly on your site in a "pay with crypto" button.

Checkout widget

Loop provides a checkout widget that can be integrated in the context of your company's website or application, to enable your customers to pay with crypto. The modal allows end users to give Loop authorization to enable autopay without ever leaving your website.

Existing customers in Stripe

If you are collecting authorization from an existing customer that is already subscribed to a Stripe plan and wants to pay in crypto, you can append the subscription ID to the end of the hosted checkout page URL. You can find details on appending the ID to the hosted checkout page here and to the modal in the NPM readme here.

Email notifications upon signup

When customers successfully enable autopay for a subscription, they will receive an email confirmation that autopay has been enabled. The email confirmation will contain the entity name, logo, and reply to the email address of the child entity, if the subscription is associated with a child entity.

Invoice payment timing

After your customer provides authorization, Loop will process payments for all finalized Invoices related to that authorization. Additionally, Loop will the Draft invoices related to that authorization in the Transfers table, for tracking purposes. Note, when Stripe finalizes invoices, Stripe's system changes the time that the invoice is due to the end of that day, which is when Loop will process the payment. Loop always updates the due date and time for the Transfer based on the current due date for the invoice in Stripe. When payments are processed, Loop marks the invoice as paid in Stripe.

5. Provide access to your end-product

Since Loop marks invoices in Stripe as paid, you can continue to use any integrations you've built off of Stripe as the method for providing access. No need to change anything.

However, if you want to provide access to your users based on a reference ID you pass to Loop or the end customer's wallet address, you can listen to Loop webhook events.

The AgreementSignedUp event lets you know that a wallet provided authorization to be billed - it does not mean you have been paid yet, but it does indicate the user has set an allowance for payments.

The TransferProcessed event is the payment notification and indicates funds have been sent to the receiving wallet. If there is a trial or coupon, there is no TransferProcessed event until the amount due is > 0 and the due date has passed.

You can use an external reference ID field that you can pass to Loop during checkout, which is also returned in the AgreementSignedUp and TransferProcessed events if it's set during checkout, to provide access to your system. You can alternatively use the wallet address or email provided in the Loop webhook AgreementSignedUp and TransferProcessed events to map to users in your system to provide access to your system.

Even with immediate invoicing, there will be a delay between the webhook events, as the transaction must be confirmed on-chain. Companies can decide to grant access based on the AgreementSignedUp event and take action if you do not hear about the TransferProcessed event within a certain amount of time, (e.g. show a warning, etc). We built Loop to be flexible, so companies can decide how "aggressive" they want to be about payment confirmation.

There are a few reasons why the TransferProcessed event would not occur:

  • The wallet does not have enough balance to cover the payment

  • The wallet does not have enough token allowance to cover the payment

  • The transaction is stuck in the mempool

  • Loop's relay network is down

Wallet amount and balance information can be found on our company dashboard for all active subscribers if you are troubleshooting a late payment.

6. Provide a method for cancelation

If a customer is canceled in Stripe, they will be canceled in Loop, and vis-versa. Concurrently, customers can cancel their future payments using Loop on our Customer Portal.

Cancel via Loop

Customers can cancel a subscription on our Customer Portal. When a customer cancels the subscription, a webhook is emitted that companies can use to be notified of this event.

When a subscription is canceled, all future scheduled invoices will be canceled but any currently due invoices will not be. Companies can cancel these scheduled payments without code by canceling the transaction on the company dashboard or via API using the PATCH Transfer call.

Cancel via Stripe

If you cancel a customer in Stripe, Stripe will stop generating invoices which means Loop will not have an invoice to pull in for future charges, effectively stopping billing. Canceling removes future invoice generation, not ones that have already been generated and pulled into Loop. Thus, if you would like outstanding invoices to be canceled, you can do so via the company dashboard on the transactions page or via API.

Additionally, you can cancel the customer and restrict any future billing in Loop on the company dashboard on the customers page or via API.

Cancel via Company

Companies can provide a way to cancel subscriptions on their own website and tell Loop about this cancellation via the PATCH agreements call.

Last updated