---
page_source: https://juspay.io/in/docs/payment-page-enterprise/react-native/mandates/mandate-revoke-api
page_title: Mandate Revoke API
---

## API Version: default


# Revoke Mandate API



Use this API to revoke/cancel an ACTIVE mandate.## Endpoints:
- Sandbox: https://sandbox.juspay.in/mandates/{mandate_id}

- Production: https://api.juspay.in/mandates/{mandate_id}

## Request Type: 
POST

## Authorization:

#### Basic Auth:
Consists of two parts.

* Username: API Key obtained from Juspay dashboard
* Password: Empty string

Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: Base64 Encoded Username:Password, Required
## Headers:

#### x-merchantid:
Merchant ID which would have been issues while registering with Juspay
- Value: Example:- 7SucJZ2PCyoGY5vvW8Xa26
- Tags: string, Required

#### Content-Type:
application/x-www-form-urlencoded
- Tags: String, Required

#### x-routing-id:
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.

> **Warning**
> This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.


- Value: customer_1122
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl POST 'https://api.juspay.in/mandates/7SucJZ2PCyoGY5vvW8Xa26' \
-H 'x-merchantid: merchant' \
-H 'Authorization: Basic <Base-64 Key>'
-H 'x-routing-id: customer_1122'\
-d 'command=revoke'
```

#### Request - Implicit Revoke at Juspay Code Snippet:

```request - implicit revoke at juspay
curl --location 'POST' \
--header 'x-merchantid: merchant' \
--header 'Authorization: Basic <Base-64 Key>' \
--header 'x-routing-id: customer_1122' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'command=revoke' \
--data-urlencode 'should_do_implicit_revoke=True'
```

### Sample Response:

#### Response - Revoke Successful:
```json
{
  "mandate_status": "REVOKED",
  "mandate_id": "ns3UFqGKHLWXNGDREXDE67"
}
```

#### Response - Revoke Failed:
```plaintext
{
    "mandate_id": "9KF38NAFKtx6Vxpztz3Wxb",
    "gateway_response_code": "200",
    "mandate_status": "ACTIVE",
    "gateway_response_message": "Bank Issues a Timeout"
}
```

#### Revoke Failure but Implicit Mandate Revoke Enabled:
```plaintext
{
    "mandate_id": "9KF38NAFKtx6Vxpztz3Wxb",
    "gateway_response_code": "200",
    "mandate_status": "REVOKED",
    "gateway_response_message": "Bank Issues a Timeout"
}
```

## Path Parameters:

#### mandate_id:
Mandate Id
- Tags: String, Required
## Body Parameters:
### Parameters:

#### command:
- Description: To be set as revoke, to revoke an existing mandate.
- Tags: string, Required

#### should_do_implicit_revoke:
- Description: This parameter should be send, if we want to revoke Mandate at Juspay’s end still if Gateway is unable to revoke at their end. We will try to revoke mandate at gateway’s end, even if it fails, we will mark it failed at Juspay’s end. 
- Tags: String, Optional
## API Responses:
### 200:

#### mandate_status:
- Description: REVOKED
- Tags: string

#### mandate_id:
- Description: 7SucJZ2PCyoGY5vvW8Xa26
- Tags: string
### 400:

#### status:
- Description: invalid_request_error
- Tags: string

#### error_message:
- Description: Mandate not found
- Tags: string

#### error_code:
- Description: Mandate not found
- Tags: string
### 401:

#### status:
- Description: error
- Tags: string

#### error_code:
- Description: access_denied
- Tags: string
