Create a refund
Initiates a refund for a successful payment.
Provider behaviour:
- Khalti - fully automated. The refund is processed immediately via the Khalti API, and the response status will be
succeededon success orfailedif Khalti rejects it. - eSewa - does not expose a public refund API. The refund is recorded with status
requires_action. You must process it manually through the eSewa merchant portal and the record will serve as your audit trail. - Fonepay - not available through this API. Fonepay refunds are full-amount only and are issued from the PayBridgeNP dashboard instead; a request against a Fonepay payment returns
422.
Partial refunds: For Khalti and eSewa, you can issue multiple partial refunds against a single payment until the total reaches the original payment amount. The amount you request may not exceed the payment’s remaining unrefunded balance.
Authorizations
Your PayBridgeNP API key. Obtain one from the dashboard under Settings → API Keys. Prefix: sk_test_ for testing, sk_live_ for production.
Body
ID of the payment to refund (prefix: pay_).
"pay_01j9x2k3m4n5p6q7r8s9t0u1v2"
Amount to refund in paisa. Must be ≤ the remaining refundable amount.
10000
Reason for the refund.
customer_request, duplicate, fraudulent, other "customer_request"
Internal note visible in the dashboard. Not shown to customers.
"Customer contacted support, order not delivered."
Customer mobile number. Required by some Khalti configurations.
"9801234567"
Response
Refund created.
"ref_01j9x2k3m4n5p6q7r8s9t0u1v2"
true when created with a live key, false for sandbox.
"pay_01j9x2k3m4n5p6q7r8s9t0u1v2"
sandbox, live Refunded amount in paisa.
10000
"NPR"
customer_request, duplicate, fraudulent, other succeeded - refund processed. requires_action - eSewa: must be processed manually via merchant portal. failed - provider rejected the refund.
processing, succeeded, failed, requires_action Provider's refund reference (Khalti only).
Set when status is failed or requires_action.