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

HeaderRequiredDescription
x-api-keyYesYour API key
Content-TypeYesapplication/json

Path parameters

ParameterTypeDescription
refundRequestIdstringThe refund request ID to cancel

Request body

FieldTypeRequiredDescription
notestringNoReason 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);