# Enrollments and access

> What an enrollment is, what each status does, until when access lasts, how to grant a delivery by hand, adjust one student's access, deactivate and delete.

The enrollment decides **whether** the student opens a product and **until when**. For example: Ana buys a 1-year course and gets an enrollment that opens the course for 1 year. The enrollment does not decide **when** each module opens; that is [drip content](https://help.cademi.cloud/en/conteudo/conteudo-programado.md).

## The idea in one minute

Think of the course as a building. The enrollment is the key to the building's door.

- The **delivery** says which building the key opens and for how long. See [Deliveries](https://help.cademi.cloud/en/vendas/entregas.md).
- The **enrollment** is one student's key. It keeps where it came from, when it started, its status and, if any, a scheduled end.
- The **access** is the result: the student opens the product or not, and until when.

A student can have several keys to the same building. Cademí combines all of them, free access and the adjustments you made for that student.

**The most important rule:** to know whether the student opens a product, look at the **Products** tab of the profile. The **Purchases** tab shows the keys one by one; the **Products** tab shows the result.

## Where each enrollment comes from

| Origin | Who creates it | Who controls it | How it shows in **Purchases** |
|---|---|---|---|
| Sale | A one-time purchase approved at the gateway | The gateway | With the **Sale ID** |
| Subscription | A recurring plan at the gateway | The gateway | With the **ID - SUBSCRIPTION** |
| Manual | You, through the dashboard, an import or an integration | The account | With the **Standalone delivery** badge |

- Every sale and every subscription gets its own enrollment. Someone who buys the same offer twice has two rows in **Purchases**.
- A manual enrollment is one per delivery. If you grant the same delivery again, Cademí uses the enrollment that already exists.

## What each status means

| How it shows | What it means | Can the student open the product? | How to undo |
|---|---|---|---|
| **Active** | The enrollment counts | Yes, until access ends | Not applicable |
| **Active**, but expired | The status is active and access has ended. Expiring is not a status: Cademí computes it from the dates | No | Extend it: time adjustment, later end or new purchase |
| **Inactive** | Switched off, but kept | No. Exception: a scheduled end in the future | Click the status to activate |
| **Cancelled** | Subscription cancelled at the gateway. The end of the paid period is set | Yes, until the end of the paid period. See **Released until**, **Products** tab | Through the gateway |
| Deleted | Manual enrollments only | No | There is no way to restore it |

The life of an enrollment in the **Purchases** tab looks like this. "Expired" is not a stored status: it is the name for an active enrollment whose access has ended.

```mermaid
stateDiagram-v2
    accTitle: Status of an enrollment
    accDescr: An enrollment starts active, from an approved sale or from Add delivery. It can be deactivated by hand or by a refund or late payment, and activated again by hand or by an approved payment. When access ends, it stays active but expired until you extend it. Only a standalone delivery can be deleted, and deleting cannot be undone.
    state "Active" as Ativo
    state "Inactive" as Inativo
    state "Active, but expired" as Vencida
    state "Deleted" as Excluida
    [*] --> Ativo: Approved sale or Add delivery
    Ativo --> Inativo: Deactivate, refund or late payment
    Inativo --> Ativo: Activate or approved payment
    Ativo --> Vencida: Access ended
    Vencida --> Ativo: Extend
    Ativo --> Excluida: Delete (Standalone delivery only)
    Inativo --> Excluida: Delete (Standalone delivery only)
    Excluida --> [*]
```

The diagram shows the status. Whether the student opens the product still depends on the dates.

**Heads up: this is where most mistakes happen.** Carla has an enrollment with a scheduled end on June 30. You deactivate it on May 10. Result: Carla still opens the course until June 30. An inactive enrollment with an end in the future counts until that date. That is how a cancelled subscription keeps the paid period. To close access now, deactivate the enrollment **and** remove the scheduled end.

**The gateway wins over what you did by hand.** On a sale or subscription, the next gateway event decides. An approved payment activates the enrollment again and clears the end you scheduled.

## Until when access lasts

- The delivery gives each product **lifetime** access or a **duration**: hours, days, weeks, months or years. The duration counts from the enrollment start.
- Months and years follow the calendar. One month from January 31 ends on February 28.
- A subscription delivery lasts "while paid". Its duration does not count. The end is the date the gateway sends when the subscription is cancelled.
- A **scheduled end** you set wins over everything on that enrollment: the delivery duration, the gateway cycle and lifetime.
- A scheduled end in the past closes access right away, even with an active status.

## When the student buys the same product more than once

- Lifetime beats any duration.
- If they buy again **before** access ends, the new time adds to what is left. Renewing early never loses days.
- If they buy again **after** access ends, a new period starts. The time left over does not carry into the new one.
- Fixed end dates do not add up. A fixed end date is a scheduled end or the end of a subscription. The latest one wins.
- "Opens N days after purchase" rules always count from the first purchase that still counts. Buying again does not close a module that already opened.

When two purchases cover the same product, the end of access comes out like this:

```mermaid
flowchart TD
    accTitle: How several purchases become one access
    accDescr: If any purchase is lifetime, with no scheduled end, access is lifetime. If not, and the new purchase came before access ended, the latest date wins when either one has a fixed end date; with no fixed date, the time adds up. If the new purchase came after the end, a new period starts.
    vit{"Any lifetime, with no scheduled end?"}
    vitalicio["Lifetime"]
    antes{"New one came before the end?"}
    fixa{"Any fixed end date?"}
    tardia["The latest date wins"]
    soma["The time adds up"]
    novo["A new period starts"]
    vit -->|Yes| vitalicio
    vit -->|No| antes
    antes -->|Yes| fixa
    antes -->|No| novo
    fixa -->|Yes| tardia
    fixa -->|No| soma
```

## Step by step

### Grant a delivery by hand

1. Open the student's profile.
2. In the sidebar, in the actions block, click **Add delivery**.
3. In **Delivery**, choose the delivery.
4. Click **Add**.

Cademí creates the manual enrollment, applies the delivery's tags and emails the student.

**Heads up: granting again does not renew.** Bruno had a manual enrollment of this delivery, and it expired. You grant the same delivery again. Cademí activates the old enrollment, with the original start date. He gets no new email and no tags again. His access stays expired. To give Bruno more time, use the per-student adjustment (below).

Archived deliveries do not appear in the list. If there is nothing to choose, the screen says there are no new deliveries for this student.

### Deactivate and activate

1. Open the **Purchases** tab of the profile.
2. Click the status of the row.

**Click to deactivate the purchase** switches the enrollment off and keeps everything. **Click to activate the purchase** switches it on again, with the same start date. If the row has **Valid until** in the future, access continues until that date.

### Schedule an access end

1. In the **Purchases** tab, open the row menu.
2. Choose **Schedule access end**.
3. In **End access on**, pick the date and time. Leave it blank for no end date.
4. Click **Save**.

The row now shows **Valid until** with the date. A date in the past closes access right away. On a sale or subscription, the next approved payment clears this date. To undo it, open the same window and click **Remove end date**.

### Delete a manual enrollment

1. In the **Purchases** tab, open the menu of a row with the **Standalone delivery** badge.
2. Choose **Delete**.
3. Confirm in **Delete purchase**.

The student loses access to that delivery. Only a **Standalone delivery** can be deleted. Sale and subscription enrollments are not deleted from the dashboard: refunds and cancellations go through the gateway.

### Per-student adjustment

The delivery and the schedule apply to every buyer. But there is always a student outside the rule. One asks for a few more days, one joins the class late, one needs to see everything at once. The per-student adjustment changes one student's access to one product, without touching the delivery. It lives in the **Products** tab of the profile.

**Change access time.** Open the product's row menu, or click the date under **Released until**. The window shows the **Current access** and three ways out:

1. **Pick a date** as the end.
2. Release as **Lifetime**.
3. Add years, months, weeks and days to the current end.

The **New access** preview shows the result before you save. Check **Apply to all of the student's courses** to use the same duration on all their products. Each product counts from its own start. **Clear customization** goes back to the delivery's period.

- The adjustment counts from the student's access start, not from today. The screen does that math for you.
- The adjustment only extends. A date before the current end is refused: "Pick a date after ... to extend access". To shorten access, schedule an end on the enrollment.
- On lifetime access, an adjustment with an end replaces lifetime with that end. The end must be in the future.
- An adjustment never grants access on its own. It needs an enrollment that still counts.

**Change release schedule.** Puts this student on another calendar of the same product, such as another class. **Defined in delivery** goes back to the default calendar. The product needs schedules for there to be something to choose.

**Release.** The badge in the column switches between **Scheduled** and **Immediate**. On **Scheduled**, the rules apply. On **Immediate**, the time, date, exam and percentage rules do not apply to this student. The certificate rule does not apply either. Hidden and "coming soon" content stays as it is. With any product on **Immediate**, the tab shows the **Content released immediately** notice.

**Delete progress.** Erases all of the student's progress in that product. It cannot be undone.

**Start all accesses.** Creates the access record of every product the student has not opened yet. The row then shows the dates and accepts the actions above.

## What the student sees

| Situation | In the student area |
|---|---|
| Active enrollment, before access ends | The product opens |
| Expired access or scheduled end in the past | The product is closed, with **Closed on** and the date |
| Inactive with no future date, deleted or no enrollment | The product appears closed. If it is set to "unlisted", it does not appear |
| Drip content rule still closed | **Opens on** and the date, or **Coming soon** when there is no date |

## Good to know

- **Deleting the student deletes no enrollment.** The enrollments stay and come back when you restore the student. To close the access of someone with a manual enrollment, delete the enrollment, or deactivate it and remove the end.
- **Archiving a delivery.** It stops receiving new sales and leaves **Add delivery**. Whoever already has the delivery keeps it.
- **Reprocessing a sale.** It does not create a second enrollment or extend access twice.
- **Starting over.** For a true restart, release calendar included, delete the enrollment and grant again. Only a new enrollment gets a new start.
- **The account's free sign-up.** It does not show in **Purchases**: it is not an enrollment and cannot be deleted. It follows the free delivery in **Settings > Students**.

## Frequently asked questions

**How do I give a student 7 more days?** In the **Products** tab, use **Change access time** and add 7 days. The preview shows the new date. Do not change the delivery: it applies to every buyer.

**The student asked for a refund. Do I delete the enrollment?** No. Refund at the gateway. The gateway's notice deactivates the enrollment. The purchase tags stay on the student; remove them by hand if a group depends on them.

**I granted the delivery again and the student still has no access.** They already had an expired manual enrollment of that delivery. Granting again uses that enrollment, with the old start. Extend it with **Change access time** or with a later end.

**I deactivated the enrollment and the student still opens the course.** The enrollment has a scheduled end in the future, and it counts until then. Remove the end in **Schedule access end**.

**Why does access end sooner than I expected?** Check **Released until** in **Products** and **Valid until** in **Purchases**. A scheduled end beats the delivery duration and lifetime. Fixed dates do not add to durations. If the student bought again after the end, the period started over.

**The student cannot get in. Where do I start?** The full checklist is in [Why the student cannot access](https://help.cademi.cloud/en/alunos/por-que-o-aluno-nao-acessa.md).
