Retrieve Refund
Check the status of a refund request
Check the current status of a refund request.
Endpoint
GET /refund/retrieve/:id
Request headers
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | Your API key |
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The refund request ID returned when you created the refund |
Response
{
"success": true,
"data": {
"refundRequestId": "refund_abc123",
"transactionId": "txn_abc123def456",
"amount": 250,
"accountType": "PERSONAL_ACCOUNT",
"accountNumber": "01712345678",
"status": "Completed",
"note": "Customer requested partial refund",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:35:00.000Z"
}
}
Status values
| Status | Description |
|---|---|
Processing | Refund is being processed |
Completed | Refund was successful |
Cancelled | Refund was cancelled or failed |
Example
const axios = require("axios");
const refundId = "refund_abc123";
const response = await axios.get(
`https://sandbox.payzava.com/cp/api/v1/refund/retrieve/${refundId}`,
{
headers: {
"x-api-key": "sk_sandbox_your_api_key",
},
}
);
const { status, amount } = response.data.data;
console.log(`Refund ${refundId}: ${status} (${amount} BDT)`);