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

# Cancel Refund

> Cancel a pending refund request

## Overview

Cancel a refund that is in pending status. Once a refund is approved or processed, it cannot be cancelled.

## Path Parameters

<ParamField path="id" type="uuid" required>
  Refund ID to cancel
</ParamField>

<ParamField path="version" type="string" required>
  API version (e.g., "1")
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Returns `true` if the refund was successfully cancelled, `false` otherwise
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://gateway.dev.waypay.live/Gateway/v1/Refunds/550e8400-e29b-41d4-a716-446655440000/cancel \
    --header 'SWICH-API-Key: pk_test_xxxxxxxx'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://gateway.dev.waypay.live/Gateway/v1/Refunds/550e8400-e29b-41d4-a716-446655440000/cancel',
    {
      method: 'POST',
      headers: {
        'SWICH-API-Key': 'pk_test_xxxxxxxx'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://gateway.dev.waypay.live/Gateway/v1/Refunds/550e8400-e29b-41d4-a716-446655440000/cancel',
      headers={
          'SWICH-API-Key': 'pk_test_xxxxxxxx'
      }
  )
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  true
  ```

  ```json 200 Failed theme={null}
  false
  ```
</ResponseExample>
