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

ParameterTypeDescription
transactionIdrequiredstringTransaction ID to refund
amountoptionalnumberRefund amount. If not provided, full refund is processed
reasonoptionalstringReason for refund

Success Response

200
json
{
  "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"
}