Refunds API
Process full or partial refunds for successful transactions.
Process Refund (Production)
POST
/api/v1/production/refundRequires API Key
Processes a refund for a successful transaction. If amount is not provided, full refund is processed.
Request Body
{
"transactionId": "TXN-20240101-ABC123",
"amount": 50.00,
"reason": "Customer requested refund"
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| transactionId | string | Yes | Transaction ID to refund |
| amount | number | No | Refund amount. If not provided, full refund is processed |
| reason | string | No | Reason for refund |
Success Response
200{
"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"
}
}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
/api/v1/sandbox/refundRequires API Key
Processes a refund in sandbox mode for testing.
Request Body
Same request body as production endpoint.
{
"transactionId": "TXN-20240101-ABC123",
"amount": 50.00,
"reason": "Customer requested refund"
}