> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dintero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Recurring subscription example

> Worked example for selling tiered yearly memberships through Dintero Checkout using stored card tokens, recurring billing, and tier upgrades or downgrades.

This example details the flow for a merchant selling memberships to their club with three tiers of memberships:

* **Tier 3**: Yearly 500,-
* **Tier 2**: Yearly 300,-
* **Tier 1**: Yearly 150,-

Since these are paid in regular intervals, we will use our recurring/subscription support.

Managing subscriptions for this club encompasses three different scenarios:

* Creating subscription for new customer
* Receive payment for subsequent periods
* Upgrading the subscription from one tier to another

## Creating subscription for a new customer

1. Create a session with the subscription
   amount, [and specifies that a recurrence token should be created](https://docs.dintero.com/docs/checkout/tokenization-create-token.md#create-token-session)
   .
2. The customer [pays](https://docs.dintero.com/docs/checkout/display-checkout.md)
3. The merchant is [notified about the successful payment](https://docs.dintero.com/docs/checkout/after-payment.md#getting-notified-about-the-transaction-status).
4. The merchant [fetches and stores the token](https://docs.dintero.com/docs/checkout/tokenization-fetching-storing.md)

## Receive payment for subsequent periods

1. Create a [recurrence transaction](https://docs.dintero.com/docs/checkout/tokenization-use-token.md#recurrence-transactions) with the previously acquired
   token
2. The merchant will receive a synchronous response about the payment status, but should also implement a callback in
   case the request failed, but the payment succeeded in the background.

## Upgrading the subscription

Let's say the customer has been a **tier 2** member for 6 months, but now they want to upgrade to **tier 3**.

They paid 300 for the full year, and the price for **tier 3** is 500.

1. Repeat the steps from [Creating subscription for a new customer](#create-subscription) for the customer to pay 500.
2. [Refund the money] for the remaining 6 months of the **tier 2** membership, 150,-
3. The merchant stops using the old recurrence token and starts using the new for subsequent payments.

[Refund the money]: https://docs.dintero.com/api-reference/transactions/transactions_id_refund_post.md


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.