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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.dintero.com/feedback

```json
{
  "path": "/docs/checkout/subscription-example",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# 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

<h2 id="create-subscription">
  Creating subscription for a new customer
</h2>

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

## Receive payment for subsequent periods

1. Create a [recurrence transaction](/docs/checkout/tokenization-use-token#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]: /payments-api.html#operation/transactions_id_refund_post
