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

# Cancel Subscription

The **Cancel Subscription API** allows a merchant to permanently terminate an active subscription. Once cancelled, the subscription will no longer generate invoices or collect recurring payments.
Canceling a subscription works differently for the Prepaid and Postpaid billing cycles. If cancelAtEnd is used, the subscription will remain in ACTIVE state until the end of the billing cycle. At the end of the billing cycle, the subscription will be auto-canceled, and no new invoice will be raised. If cancelNow is used, it will change the status from ACTIVE to CANCELLED then only.

For Prepaid, cancelNow will not revert the amount paid at the start of the cycle but will issue adjustment credits for that customer, which can be used in the future for any subscription payments. Therefore, it is recommended to use cancelAtEnd to cancel a ACTIVE subscription.

For Postpaid, cancelNow and cancelAtEnd can be used. If cancelNow is used, it will raise a pro-rate-based invoice and will try to debit the amount using the auto-debit mandate if available.

> **Note:** A cancelled subscription cannot be resumed. If the customer wishes to subscribe again, a new subscription must be created.

***

## Common Use Cases

| Scenario                        | Illustration                                                                                   |
| ------------------------------- | ---------------------------------------------------------------------------------------------- |
| Customer requests cancellation  | The customer no longer wishes to continue the subscription service.                            |
| Service discontinued            | The merchant permanently discontinues the subscribed product or service.                       |
| Account closure                 | The customer closes their account and all recurring billing must stop.                         |
| Fraud or policy violation       | The merchant detects fraudulent activity or a breach of terms and terminates the subscription. |
| Migration to a new subscription | The customer is moved to a new subscription plan that requires creating a new subscription.    |
| Compliance requirements         | Regulatory or business policies require the subscription to be permanently cancelled.          |

***

## Mandate after Cancellation

Once the subscription is marked as CANCELLED, the associated payment mandate will be automatically revoked. This ensures that no further payments are collected from the customer for the cancelled subscription.

***

## Cancel Flow

```mermaid theme={null}
sequenceDiagram

participant Merchant
participant TB as Transact Bridge
participant Subscription

Merchant->>TB: Cancel Subscription API
TB->>Subscription: Validate ACTIVE subscription
Subscription-->>TB: Valid
TB->>Subscription: Update subscription status to CANCELLED
TB->>Subscription: Update mandate status to REVOKED
Subscription-->>TB: Stop future billing
TB-->>Merchant: Success Response
```

***

## Cancel API

Refer to <a href="https://docs.transactbridge.com/#ba15b59d-5704-44b0-8d54-5df8d83199d4"> Cancel API </a> to cancel a subscription.

***

## Notes

* Only subscriptions in the **ACTIVE** state can be cancelled.
* Cancelling a subscription permanently stops future recurring billing.
* No additional invoices are generated after the subscription is cancelled.
* A cancelled subscription cannot be resumed using the Unpause API.
* To restart billing, create a new subscription for the customer.
