> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.paywithatoa.co.uk/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Refund | Refunds API

> Cancel refund via the Atoa Refunds API, request parameters, response schema and code samples in cURL, Python, JavaScript, PHP, Go and Java.

This API allows you to cancel a refund that is still in a pending state and has not yet been processed. Once canceled, the refund will not be disbursed to the customer’s bank account.

<Note icon="lightbulb" title="Note">
  You can only cancel refunds that are in a pending state and have not been
  processed yet.
</Note>

<Info icon="lightbulb" title="Note">
  Sandbox environment refund cancellations cannot be simulated.
</Info>

### Authorization

Bearer `<token>`

### Request Body Schema

<ParamField path="refundId" type="string" required>
  The unique identifier of the refund you want to cancel. This is the refundId
  that was returned when you initiated the refund from{" "}
  <a href="/api-reference/Refund/initiateRefund">Initiate Refund</a>.
</ParamField>

### Response

<ResponseField name="status" type="number">
  The HTTP status code indicating the result of the operation. A value of 200
  indicates success.
</ResponseField>

<ResponseField name="message" type="string">
  A human-readable message describing the result of the operation.
</ResponseField>

<ResponseField name="refundId" type="string">
  The unique identifier of the refund that was cancelled.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "status": 200,
    "message": "Refund cancelled successfully",
    "refundId": "4fcddd66-4425-4bf7-88cc-96463e279eb1"
  }
  ```

  ```json 400 theme={null}
  {
    "name": "BadRequestException",
    "message": "Refund not found"
  }
  ```
</ResponseExample>
