> For the complete documentation index, see [llms.txt](https://loop-crypto.gitbook.io/old-loop-crypto/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://loop-crypto.gitbook.io/old-loop-crypto/dashboard-functionality/subscriptions.md).

# Subscriptions

This page will walk you through creating subscriptions in Loop. If you haven't already set up your Loop entity, make sure to head back up to the [Getting Started](/old-loop-crypto/getting-started.md) page.

Collecting crypto subscriptions on-chain can be done in 5 simple steps. These steps can be completed via our dashboard (no-code) or via our [SDK / API calls](/old-loop-crypto/technical-docs/sample-guide-collect-a-subscription-or-one-time-payment.md).&#x20;

1. [Create a subscription ](#id-1.-create-a-subscription)
2. [Collect authorization](#id-2.-collecting-authorization)&#x20;
3. [Invoice (i.e. schedule payment) ](#id-3.-invoice)
4. [Configuring webhooks and granting access](#id-4.-configuring-webhooks-and-granting-access)
5. [Handling cancellations](#id-5.-cancellations)&#x20;

***

### 1. Create a subscription&#x20;

On the [company dashboard](https://admin.loopcrypto.xyz/login), on the "subscriptions" page, companies can add a new subscription product using the form. When creating a subscription, you are able to select which [tokens you want to accept by network](/old-loop-crypto/learn/core-components/collecting-authorization/enabling-payment-on-multiple-networks.md), and you can elect to enable [auto-invoicing](/old-loop-crypto/dashboard-functionality/subscriptions/auto-invoicing.md), among other fields.

Once a subscription is added, the subscription will be included in the table and a [hosted checkout page](/old-loop-crypto/technical-docs/archeticture/collecting-authorization/checkout-page.md) will automatically be generated.&#x20;

### 2. Collecting authorization&#x20;

Loop provides a custom [checkout page](/old-loop-crypto/technical-docs/archeticture/collecting-authorization/checkout-page.md) for each item with the type of "subscription, donation, and fee". 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](/old-loop-crypto/technical-docs/archeticture/collecting-authorization/checkout-page/add-pay-with-crypto-button.md)" button.&#x20;

### 3. Invoice

Once you have authorization to bill a customer, you can then schedule payments. You can choose to auto-invoice or bill manually.&#x20;

#### Auto-invoicing

*This is best for companies that have fixed payment amounts and dates (i.e. $30/mo every month).*&#x20;

Loop will automatically generate the next invoice for subscriptions and one-time payments (called [items](/old-loop-crypto/technical-docs/apis/items.md)) with [auto-invoicing](/old-loop-crypto/dashboard-functionality/subscriptions/auto-invoicing.md) enabled based on the item's payment frequency and amount specified.

#### Manually &#x20;

*This is best for companies who may have changing payment amounts and dates and thus require flexibility in scheduling payments or are using Loop to schedule outbound payments.*&#x20;

Companies generate an invoice (called a [transfer requests](/old-loop-crypto/technical-docs/apis/transfer-requests.md)) on our [company dashboard](https://admin.loopcrypto.xyz/login) via the invoice button on the Customers page. Here you can type in the details of the invoice and schedule the payment.&#x20;

### 4. Configuring webhooks and granting access &#x20;

Loop uses [webhooks](/old-loop-crypto/technical-docs/apis/webhooks.md) to notify you of events. You can configure these webhooks to go to [Slack, Airtable or Discord](/old-loop-crypto/technical-docs/apis/webhooks/slack-airtable-discord-telegram.md) to be notified immediately of a payment by simply providing an endpoint.

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.&#x20;

The `TransferProcessed` event is the payment notification and indicates funds have been sent to the receiving wallet.

#### Granting access

You can use the `wallet address,` `email, or` `a reference ID` provided in either of these events to provide access to your system.&#x20;

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.&#x20;

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

* The wallet does not have enough balance to cover the payment&#x20;
* The wallet does not have enough token allowance to cover the payment&#x20;
* The transaction is stuck in the mempool&#x20;
* Loop's relay network is down&#x20;

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

### 5. Cancellations&#x20;

Customers can cancel a subscription either:&#x20;

1. directly with the end company and the company can cancel the customer on Loop's dashboard on the Customers page or
2. the customer can cancel directly on  [Loop's Portal](https://my.loopcrypto.xyz/login).&#x20;

Regardless of method, Loop will emit a `AgreementCancelled` events that can be used to manage the end customer's access. &#x20;

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

Companies can listen to [webhooks](/old-loop-crypto/technical-docs/apis/webhooks.md) to subscribe to events about customer-initiated cancellations.&#x20;
