Handling Refunds
This guide explains how to process refunds through the SwiftPay API.How Refunds Work
When you create a refund:- The refund is created in
pendingstatus - We process the refund with our payment processor
- The refund status updates to
completedorfailed - Webhooks notify you of the status change
Refunds can only be created for
completed checkout sessions.Creating a Refund
Full Refund
To refund the full amount of a payment:Response
Refund Statuses
| Status | Description |
|---|---|
pending | Refund created, awaiting processing |
processing | Refund is being processed |
completed | Refund successful, funds returned |
failed | Refund failed |
Checking Refund Status
Get a Specific Refund
List All Refunds
Filter by Transaction
Refund Webhooks
Subscribe to refund events to get real-time updates:| Event | Description |
|---|---|
refund.completed | Refund processed successfully |
refund.failed | Refund failed |
Example Webhook Payload
Refunds and Reserves
When processing a refund:- We first check your available balance
- If insufficient, we consume from your active reserves (oldest first)
- If still insufficient, the refund will fail
Processing Time
| Type | Processing Time |
|---|---|
| Card Refund | 5-10 business days |
Refund processing time depends on the customer’s bank and card network.
Best Practices
Always Provide a Reason
Always Provide a Reason
Include a clear reason for every refund. This helps with:
- Internal tracking
- Customer communication
- Dispute resolution
Check Balance First
Check Balance First
Before creating a refund, check your available balance to ensure sufficient funds:
Use Webhooks
Use Webhooks
Don’t poll for refund status. Use webhooks to get real-time updates when a refund completes or fails.
Handle Failures Gracefully
Handle Failures Gracefully
If a refund fails, notify your customer and provide alternative resolution options.
Common Issues
Insufficient Balance
Session Not Completed
completed.