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

# Mandate health

# Mandate Health Scoring & Pre-emptive Campaigns

Fype monitors the status of active billing mandates using a real-time **Mandate Health Score** to predict and prevent involuntary churn.

***

## The Health Scoring Formula

Every subscription with a recurring mandate is assigned a health score ranging from `0.0` (critical failure risk) to `100.0` (highly reliable).

$\text{Health Score} = \text{Historical Weight} + \text{Instrument Modifier} + \text{Bank Success Rate} + \text{Recency Decay} + \text{Engagement Modifier}$

### Scoring Components Breakdown:

| Component                   | Weight         | Calculation Logic                                                                                         |
| :-------------------------- | :------------- | :-------------------------------------------------------------------------------------------------------- |
| **Historical Success Rate** | **Max 30 pts** | Ratio of successful payment cycles to total attempts: $\text{Ratio} \times 30$.                           |
| **Payment Instrument**      | **Max 15 pts** | - **eNACH / Bank Mandate**: 15 pts<br />- **UPI Autopay**: 12 pts<br />- **Credit / Debit Cards**: 10 pts |
| **Real-time Bank Health**   | **Max 15 pts** | Based on current gateway API success rates for the issuing bank (e.g. HDFC, ICICI).                       |
| **Recency Decay**           | **Max 20 pts** | Mandates that haven't successfully processed a charge in over 45 days are penalized up to 20 pts.         |
| **Customer Engagement**     | **Max 20 pts** | Awarded if the customer has opened billing portal links or updated card details recently.                 |

***

## Pre-emptive Recovery Campaigns

Instead of waiting for a transaction to fail, Fype uses the health score to recover degrading mandates:

```mermaid theme={null}
graph TD
    Sub[Active Subscription] -->|Evaluate| Score{Health Score < 50?}
    Score -->|No| Safe[Maintain standard cycles]
    Score -->|Yes| Alert[Trigger Pre-emptive Campaign]
    Alert -->|Action 1| WhatsApp[Send WhatsApp alert with card update link]
    Alert -->|Action 2| Email[Send invoice summary & alternative UPI checkout link]
    Alert -->|Action 3| Flag[Flag in Dashboard for support team follow-up]
```

### Campaign Actions:

* **Alert Trigger**: If a subscription's mandate health score **drops below 50.0**, Fype flags the account.
* **Customer Nudges**: Fype triggers a notification campaign (email, SMS, WhatsApp) prompting the customer to verify their bank balance, approve pending mandates, or update their payment card details in the Hosted Customer Portal.
* **Goal**: Resolve payment instrument issues *before* the next billing date to maintain an uninterrupted service state.
