After the Payment
Refunds API
Process full or partial refunds for successful transactions.
Process Refund (Production)
POST
ProductionAPI Key
Processes a refund for a successful transaction. If amount is not provided, full refund is processed.
Request Body
json
{
"transactionId": "TXN-20240101-ABC123",
"amount": 50.00,
"reason": "Customer requested refund"
}Request Parameters
| Parameter | Type | Description |
|---|---|---|
transactionIdrequired | string | Transaction ID to refund |
amountoptional | number | Refund amount. If not provided, full refund is processed |
reasonoptional | string | Reason for refund |
Success Response
200json
{
"success": true,
"data": {
"refundId": "REF-20240101-XYZ789",
"transactionId": "TXN-20240101-ABC123",
"amount": 50,
"status": "PENDING",
"reason": "Customer requested refund",
"createdAt": "2024-01-01T12:00:00Z"
}
}Note
Refunds can only be processed for transactions with status
SUCCESS. Partial refunds are allowed, but the total refunded amount cannot exceed the original transaction amount.Process Refund (Sandbox)
POST
SandboxAPI Key
Processes a refund in sandbox mode for testing.
Same request body as production endpoint.
Request Body
json
{
"transactionId": "TXN-20240101-ABC123",
"amount": 50.00,
"reason": "Customer requested refund"
}