> For the complete documentation index, see [llms.txt](https://docs.hyperswitch.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyperswitch.io/integrations/prism/node/recurring-payment-service/revoke.md).

# Revoke

## Overview

The `revoke` method cancels an existing recurring payment mandate. Once revoked, no future automatic charges can be made using this mandate.

**Business Use Case:** A customer cancels their SaaS subscription. You call `revoke` to stop all future billing and comply with their cancellation request.

## Purpose

| Scenario                  | Benefit                                              |
| ------------------------- | ---------------------------------------------------- |
| Subscription cancellation | Honor customer cancellation requests                 |
| Compliance                | Meet regulatory requirements                         |
| Customer retention        | Clean revocation improves re-subscription likelihood |

## Request Fields

| Field       | Type   | Required | Description              |
| ----------- | ------ | -------- | ------------------------ |
| `mandateId` | string | Yes      | The mandate ID to revoke |
| `reason`    | string | No       | Reason for revocation    |

## Response Fields

| Field        | Type          | Description            |
| ------------ | ------------- | ---------------------- |
| `mandateId`  | string        | The revoked mandate ID |
| `status`     | MandateStatus | REVOKED                |
| `revokedAt`  | string        | ISO 8601 timestamp     |
| `statusCode` | number        | HTTP status code       |

## Example

### SDK Setup

```javascript
const { RecurringPaymentClient } = require('hyperswitch-prism');

const recurringClient = new RecurringPaymentClient({
    connector: 'stripe',
    apiKey: 'YOUR_API_KEY',
    environment: 'SANDBOX'
});
```

### Request

```javascript
const request = {
    mandateId: "mandate_xxx",
    reason: "customer_canceled"
};

const response = await recurringClient.revoke(request);
```

### Response

```javascript
{
    mandateId: "mandate_xxx",
    status: "REVOKED",
    revokedAt: "2024-01-15T10:30:00Z",
    statusCode: 200
}
```

## Important Notes

* **Immediate effect** - Revocation takes effect immediately
* **No refunds** - Revoking doesn't refund past charges
* **Idempotent** - Multiple calls return same result
* **No undo** - Create new mandate if needed

## Next Steps

* [charge](/integrations/prism/node/recurring-payment-service/charge.md) - Process payments before revocation
* [setupRecurring](/integrations/prism/node/payment-service/setup-recurring.md) - Create new mandate if customer resubscribes


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hyperswitch.io/integrations/prism/node/recurring-payment-service/revoke.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
