# Subscription Management & Recurring Billing in Agency Handy

Managing subscriptions efficiently is crucial for agencies offering recurring services. **Agency Handy** provides a seamless **subscription management system** that automates invoicing, streamlines payment processing and ensures smooth client interactions. This guide walks you through the entire process—from creating a subscription service to handling renewals, failed payments, and cancellations. With features like **automated invoices, multiple billing cycles, and detailed tracking**, Agency Handy ensures agencies can focus on delivering value while the system takes care of billing and payments.

### **Pre-Conditions**

* **Role Access:** Available to **SuperAdmin, Admin, PM, and Clients**.
* **Payment Integration:** Requires Stripe/PayPal integration for automatic payment processing.
* **Service Setup:** The service must have a **recurring payment** option enabled.
* **Client Subscription:** Clients must have an active subscription before recurring billing is triggered.
* **Order Management:** Agencies must configure **renewal behavior** for each subscription.

***

### **1. Creating a Subscription Service**

### **Step 1: Access Service Creation**

1. Go to *Agency Handy Dashboard*.
2. Navigate to *Services* from the sidebar.
3. Click on *Create New Service*.

### **Step 2: Define Subscription Details**

1. **Service Type**: Select **Subscription** as the service type.
2. **Payment Type**: Choose **Recurring**.
3. **Billing Cycle**: Select the desired billing frequency:
   * Daily
   * Weekly
   * Monthly
   * Yearly
4. **Renewal Behavior**: Choose one of the following options:
   * **Create New Order**: Generates a new order with updated deadlines for each billing cycle.
   * **Update Existing Order**: Changes the status to "Ongoing" and refreshes deadlines without creating a new order.
   * **Keep Unchanged**: Maintains the current order while generating recurring invoices.

### **Step 3: Set Pricing and Payment Method**

1. **Subscription Fee**: Enter the recurring payment amount.
2. **Payment Method**: Select the preferred payment gateway:
   * *Stripe*
   * *PayPal*
   * *Manual*

### **Step 4: Save and Publish**

1. Review the details.
2. Click *Save* to draft the service or *Publish* to make it available for purchase.

***

### **2. Subscription Creation Flow**

Once a client purchases the subscription service:

1. A **Subscription** is created under *Subscription Management*.
2. An **Order** is automatically generated within that subscription.
3. An **Invoice** linked to the order is created with the following behavior:
   * **For Self-Checkout Orders**:
     * The invoice is marked as *Paid* automatically.
     * Payment is processed immediately using the stored payment method.
   * **For Manual Orders**:
     * An invoice is created and sent to the client for payment.
     * Payment must be manually confirmed by the agency.

***

### **3. Managing Subscriptions**

### **Accessing Subscription Details**

1. Go to *Subscription Management* from the sidebar.
2. Select the desired subscription to view its details, including:
   * Subscription ID
   * Client Name
   * Service Name
   * Subscription Fee
   * Number of Orders
   * Last Payment Date
   * Next Payment Date
   * Total Payments Made
   * Subscription Status (Active / Inactive)

### **Editing Subscription Details**

1. Click on *Edit* in the subscription details page.
2. Modify fields such as:
   * Payment Method
   * Billing Cycle (only for upcoming payments)
3. Save changes to update the subscription settings.

### **Cancelling a Subscription**

1. Click on *Cancel Subscription* in the subscription details page.
2. If canceling the last active order, a confirmation popup will appear:
   * *"Do you also want to cancel the subscription?"*
   * Select *Yes* to cancel the subscription.
   * Select *No* to keep the subscription active while canceling the order.

> **Note:** Clients cannot cancel their own subscriptions. Only *Super Admin* and *Admin* have this permission.

***

### **4. Invoice and Payment Processing**

### **Automatic Invoice Generation**

1. **Self-Checkout Orders**:
   * Invoices are automatically marked as *Paid* once the payment is processed.
2. **Manual Orders**:
   * Invoices are sent to clients for payment confirmation.
   * Status is updated to *Paid* once manually confirmed by the agency.

### **Payment Failure Handling**

If a payment fails:

1. The invoice status remains *Open*.
2. A new order is generated.
3. A **Failed Payment Notification** is sent to both the client and the agency.
4. Agency can retry the payment or request the client to update payment details.

***

### **5. Notifications & Email Updates**

#### **Before Subscription Renewal (Self-Checkout Orders)**

* **Subject:** Subscription Renewal Reminder for \[Service\_Name] with \[Company\_Name]
* **Notification:** Sent X days before renewal.

#### **After Successful Payment**

* **Subject:** Payment Received for Invoice \[Invoice\_Number]
* **Notification:** Sent immediately upon payment confirmation.

#### **Failed Payment Notification**

* **Admin Notification:** "There was a problem processing \[Client\_Name]’s payment for \[Service\_Name]."
* **Client Notification:** "Your payment for \[Service\_Name] could not be processed. Please update your payment method."
* **Email to Client:**
  * **Subject:** Action Required: Payment for \[Service\_Name] Failed
  * "Your recent payment for \[Service\_Name] was unsuccessful. We will retry automatically."
* **Email to Agency:**
  * **Subject:** Payment Failure Notification for \[Client\_Name]
  * "Payment for \[Client\_Name]’s \[Service\_Name] was unsuccessful. Please follow up."

***

### **6. Service Deletion Rules**

* Services with active subscriptions cannot be deleted.
* The *Delete* button will be hidden for such services.
* To delete, first cancel all active subscriptions linked to the service.

***

### **Important Notes**

1. **Unpaid Self-Checkout Attempts Become "Leads"**
   * Clients remain as **Leads** until they make a purchase.
2. **Handling Multiple Invoices**
   * Only **manual orders** allow multiple invoices to repeat.
   * Orders will repeat even if no invoice is generated.
3. **Manual Invoice for Stripe/PayPal**
   * Only **one-time** invoices can be manually added.
4. **Currency Restrictions**
   * Currency **cannot be changed** in manual orders.
5. **Manual Invoice Pricing**
   * Invoice billing cycles are separate from orders.
6. **Repeating Old Invoices**
   * Old invoices **do not** repeat indefinitely.
   * A **repeat limit** is introduced.
7. **Invoice Due Date**
   * The due date is **auto-set** based on the billing cycle.
8. **Subscription Timeline**
   * A **detailed subscription page** is accessible by clicking the Subscription ID.
