Refunds API

Process full or partial refunds for successful transactions.

Process Refund (Production)

POST/api/v1/production/refund
Requires 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

ParameterTypeRequiredDescription
transactionIdstringYesTransaction ID to refund
amountnumberNoRefund amount. If not provided, full refund is processed
reasonstringNoReason 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/refund
Requires 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"
}