# Subscriptions

A subscription sells a product variant again and again: every week, month or year the shop places a new order for the
customer and takes the payment from the card they saved on the first order. Each renewal is an ordinary order, so it
is picked, shipped, invoiced and sent to e-Factura like any other. You need *Manages subscription plans and
customers' subscriptions* (Shop manager and Order operator have it by default).

## Plans

**Abonamente → Planuri → Plan nou**:

- **Nume**: what the customer sees, e.g. "Livrare lunară".
- **SKU**: the variant delivered at every renewal.
- **Preț pe bucată**: in lei, VAT included, for one period. It can be lower than the usual price ("subscribe and
  save").
- **La fiecare** and **Unitate**: every 2 weeks, every month, every year.
- **De vânzare**: switch it off to stop new subscriptions; running ones go on.

The product page shows the plans under the buy button. A subscription keeps the price it started with; a new price
applies to new subscriptions only.

## How a customer subscribes

The customer signs in, picks the quantity and goes through the usual checkout. A subscription cannot be paid cash on
delivery. Before placing the order they tick an unticked box agreeing to recurring payments: the amount, how often,
and that it runs until they cancel from their account. The card is kept by the payment processor (the shop never
sees its number). When the first order is paid the subscription starts and the customer gets an e-mail with its terms
and how to cancel.

Card renewals need a processor that can charge a saved card. Stripe can; with the others (and for bank transfer) the
renewal order is created and the customer gets an e-mail with the link to pay it.

## Renewals and unpaid ones

The scheduled task *Reînnoiește abonamentele* runs every hour. For each subscription that is due it places the renewal
order and charges the saved card. When the card is declined (or the bank wants the customer to confirm), the
subscription shows **Plată restantă**, the customer gets an e-mail with the order's payment link, and the charge is
retried after the days set under **Abonamente → Planuri → Plăți neîncasate** (by default after 1, 3 and 7 days).
After the last retry the unpaid order is cancelled and the subscription is cancelled, or paused if you chose so.

## What the customer and you can do

From **Contul meu → Abonamente** the customer can skip the next order, pause, resume and cancel, each in one click. A
paid-up subscription that is cancelled runs to the end of the period already paid for, then ends; one with an unpaid
renewal stops at once. On **Abonamente**, open a subscription to see its orders and history and to do the same on the
customer's behalf; what staff did is marked in the history.

When a customer's account is deleted, their running subscriptions stop and their saved cards are deleted.

Not yet: free trials, a setup fee, changing plan, and extending a licence key on renewal.
