---
page_title: Cancel API
product: Payout
page_source: https://juspay.io/in/docs/payout/docs/integration/cancel-api
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fpayout%2Fdocs%2Fintegration%2Fcancel-api
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/payout/llms.txt
---

## API Version: default


# Cancel API



This API can be used to schedule a fulfillment for cancellation. The merchant needs to provide the fulfillment ID in the API request.Please note that triggering the cancel API does not guarantee the cancellation of the fulfillment. Merchants should always verify the status of the fulfillment via the dashboard or by using the status API after a short period to check whether the fulfillment is cancelled or not.

> **Note**
> An fulfillment can only be canceled in some certain circumstances only. We will try to cancel as best case scenario, but we can't guarantee the outcome. - in case the order is already attempted/pending at downstream gateway or picked for attempt in our transaction processing queue it cannot be cancelled

## Endpoints:
- Sandbox: https://sandbox.juspay.in/payout/merchant/v1/fulfillment/:fulfillmentId/cancel

- Production: https://api.juspay.in/payout/merchant/v1/fulfillment/:fulfillmentId/cancel

## Request Type: 
POST

## Authorization:

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

* Username: API Key obtained from Juspay dashboard
* Password: Empty string
- Value:  Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: String, Mandatory
## Headers:

#### x-merchantid:
Pass merchant-id provided by Juspay
- Tags: string

#### 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 --location --request POST 'https://sandbox.juspay.in/payout/merchant/v1/fulfillment/51b6b03xxxxxxxxxxxc4f033f-f1/cancel' \
--header 'Authorization: Basic MzMXXXXXXXXXXXXXXXXXXXXXX=='
```

### Sample Response:

#### Not Found (Response Code - 404):
```json
{
    "error": true,
    "errorCode": "E09",
    "errorMessage": "Could not find resource: Fulfillment 51b6xxxxxxxxxxxxxxxf",
    "userMessage": "Not Found"
}
```

#### Response Code: 200:
```plaintext
{
    "status": "Fulfillment is scheduled for cancelation. Please check order status for final status."
}
```

## Path Parameters:

#### fulfillmentId:
Please pass the id of the fulfillment.
- Tags: String, Mandatory
## API Responses:
### 200:

#### status:
- Description: Possible Values:“Fulfillment is scheduled for cancelation. Please check order status for final status.”
- Tags: String
### 404:

#### error:
- Tags: Boolean

#### errorCode:
- Tags: String

#### errorMessage:
- Tags: String

#### userMessage:
- Tags: String


---

## See Also

- [Outage API](https://juspay.io/in/docs/payout/docs/integration/outage-api)
- [IFSC Validation ](https://juspay.io/in/docs/payout/docs/integration/ifsc-validation)
