Cancel Refund
Cancel a pending refund request
Cancel a refund request that is still in Processing status.
Endpoint
PATCH /refund/cancel-by-platform/:refundRequestId
Note:
You can only cancel a refund while its status is Processing. Once
a refund is Completed or Cancelled, it cannot be cancelled.
Request headers
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | Your API key |
Content-Type | Yes | application/json |
Path parameters
| Parameter | Type | Description |
|---|---|---|
refundRequestId | string | The refund request ID to cancel |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
note | string | No | Reason for cancelling the refund |
Response
{
"success": true,
"data": {
"refundRequestId": "refund_abc123",
"status": "Cancelled",
"note": "Customer no longer wants refund",
"updatedAt": "2024-01-15T11:00:00.000Z"
}
}
Example
const axios = require("axios");
const refundRequestId = "refund_abc123";
const response = await axios.patch(
`https://sandbox.payzava.com/cp/api/v1/refund/cancel-by-platform/${refundRequestId}`,
{
note: "Customer changed their mind",
},
{
headers: {
"Content-Type": "application/json",
"x-api-key": "sk_sandbox_your_api_key",
},
}
);
console.log("Refund cancelled:", response.data.data.status);