---
page_title: Cancel API
product: Hypercheckout
platform: Android
page_source: https://juspay.io/in/docs/hyper-checkout/android/base-sdk-integration/cancel-api
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fhyper-checkout%2Fandroid%2Fbase-sdk-integration%2Fcancel-api
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/hyper-checkout/llms.txt
---

## API Version: default


# Cancel Order API



This document provides technical guidance for merchants to **cancel an active payment link**  via the API.

> **Note**
> * A cancelled order cannot be reactivated. A new payment link must be generated if needed.
> * Ensure the order being cancelled is in `ACTIVE` state; otherwise, cancellation may fail or have no effect.

## Endpoints:
- Sandbox: https://sandbox.juspay.in/merchants/{merchant_id}/order/{order_id}/cancel

- Production: https://api.juspay.in/merchants/{merchant_id}/order/{order_id}/cancel

## Request Type: 
POST

## Content-Type: 
application/json

## Authorization:

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

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

#### x-merchantid:
Merchant ID provided by Juspay
- Value: merchant_id
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location 'https://api.juspay.in/merchants/{merchant_id}/order/{order_id}/cancel' \
--header 'Content-Type: application/json' \
--header 'x-merchantid: merchant_id' \
--header 'Authorization: Basic MDE4NXXXXXXXXXXXXXX5NTMwQzI1Og==' \
--data '{
    "cancel_reason": "Testing"
}'
```

### Sample Response:

#### Response:
```plaintext
{
    "status": "Success",
    "message": "Order cancelled successfully",
    "order_id": "1747643180"
}
```

## Path Parameters:

#### merchant_id:
Merchant ID provided by Juspay
- Tags: String, Required

#### order_id:
Order Id for which cancellation is required
- Tags: String, Required
## Body Parameters:
### Basic Parameters:

#### cancel_reason:
- Description: Reason for cancellation
- Value:  Example: Duplicate Request
- Tags: String, Required
## API Responses:
### 200:

#### status:
- Value: Success
- Tags: String

#### message:
- Value: Order cancelled successfully
- Tags: String

#### order_id:
- Value: Order ID for which the request was for
- Tags: String


---

## See Also

- [Session API](https://juspay.io/in/docs/hyper-checkout/android/base-sdk-integration/session)
- [Order Status API](https://juspay.io/in/docs/hyper-checkout/android/base-sdk-integration/order-status-api)
