Voids and Refunds
Learn how to cancel payments with voids and return funds with refunds
Voids and refunds allow you to reverse payments that have been processed. Voids cancel payments before they settle, preventing funds from being transferred. Refunds return funds to customers after a payment has settled. Understanding when to use each ensures proper fund management and provides a smooth customer experience.
Use voids to cancel payments before settlement (typically same day) and refunds to return funds after settlement. Voids prevent the original transaction from completing, while refunds create a new transaction that reverses a completed payment.
Prerequisites
Before implementing voids and refunds, it's helpful to learn about the following topics.
Learn about payment processing
Understand how payments are processed, including authorization, settlement, and clearing flows.
Learn about transaction webhooks
Monitor transaction lifecycle events to track void and refund status changes.
Understanding Voids vs Refunds
Voids and refunds serve different purposes in the payment lifecycle and have different eligibility requirements.
Voids
A void cancels a payment before it settles with the bank or card network. When you void a payment:
- The transaction is canceled before funds are transferred
- No money moves from the customer
- The authorization hold on the customer's card is released
Refunds
A refund reverses funds after a transaction has settled. When you refund a transaction:
- A new transaction is created to reverse the original transaction
- For payments: Funds are returned to the customer from your processing account
- For payouts: Funds are reversed from the recipient back to your processing account
- Takes 3-5 business days for funds to complete the transfer
- Available after transaction has settled
Finalized Timing: Payments typically finalize by the end of the business days. Check the
transaction's finalized property to determine if it can be voided or requires a refund.
Voiding Payments
Cancel a payment before it settles by updating its status to voided.
This example demonstrates voiding a payment:
- Retrieve the payment transaction by ID
- Update the transaction status to
voided - The authorization hold is released immediately
- Customer is not charged
A payment can only be voided while its finalized property is false. Once a payment is
finalized (finalized is true), it has settled and must be refunded instead.
Void Timing: Voids must be processed before the daily settlement cutoff (typically 6 PM eastern). After this time, the payment will settle and can only be refunded.
Refunding Payments
Return funds to customers by creating a refund transaction.
Refund the entire payment amount
Create a refund transaction for the full amount of the original payment.
This example demonstrates a full refund:
- Retrieve the original payment transaction
- Create a new transaction with
type='refund' - Set the refund amount to the original payment amount
- Link to the original payment using
transferswithassoc_transaction_id - Funds are returned to the customer's original payment method
The refund processes through the same payment network as the original payment. Funds typically appear in the customer's account within 3-5 business days.
Refund part of the payment amount
Create a refund transaction for less than the original payment amount.
This example demonstrates a partial refund:
- Retrieve the original payment transaction
- Create a new transaction with
type='refund' - Set the refund amount to less than the original payment
- Link to the original payment using
transferswithassoc_transaction_id - Include a description explaining the partial refund reason
- Only the specified amount is returned to the customer
You can process multiple partial refunds against the same payment, as long as the total refunded amount doesn't exceed the original payment amount.
Partial Refund Limits: The total of all refunds for a payment cannot exceed the original payment amount. Track refund totals to ensure you don't attempt to refund more than was collected.
Checking Refund Eligibility
Verify whether a payment can be voided or must be refunded based on its finalization status.
This example demonstrates eligibility checks:
- Retrieve the payment transaction
- Check the
finalizedproperty to determine current state - If
finalizedisfalse, the payment can be voided - If
finalizedistrue, the payment has settled and must be refunded
Checking eligibility before attempting voids or refunds prevents errors and ensures proper fund handling.
Finalization Status: The finalized property indicates whether a transaction has been
finalized for settlement. Voids are only possible when finalized is false. Once
finalized is true, only refunds are available.
Handling Refund Failures
Properly handle scenarios where refunds cannot be processed.
Common refund failure scenarios:
- Invalid Payment Method: Original payment method is closed or invalid
- Exceeded Amount: Refund amount exceeds original payment
- Already Refunded: Payment has already been fully refunded
- Network Issues: Temporary problems with payment network
Testing Voids and Refunds
Test void and refund functionality in test mode before production deployment.
Test voiding payments before settlement
Use test card numbers to create payments, then immediately void them:
Test refunding finalized payments
Create test payments and wait for them to finalize before processing refunds:
Test Mode Refunds: Refunds can only be created after a transaction is finalized
(finalized is true). In test mode, transactions finalize quickly and refunds are processed
immediately without the 3-5 day wait. Use test card number 4111111111111111 for successful
test payments.
Monitoring Voids and Refunds
Track void and refund operations through webhooks and transaction queries.
Webhook Events
Monitor these webhook events for void and refund operations:
-
void- Payment was successfully voided -
refund- Refund transaction was created -
processed- Refund completed and funds transferred -
decline- Payment declined before processing
For detailed webhook setup and implementation, see Transaction Webhooks.
Querying Transactions
List voided and refunded transactions:
Use queries to:
- Generate refund reports for accounting
- Monitor refund rates by product or service
- Identify high-refund accounts or customers
- Track refund processing times
- Analyze refund reasons
Schema Reference
The following fields are relevant for void and refund operations:
Transaction Fields
typepayment, deposit, withdraw, refund, payoutamountdescriptionstatuscodeapproved, card_expired, duplicate_attempt, exceeded_limit, general_decline, insufficient_bal, invalid_card_code, invalid_card_number, invalid_zip, invalid_address, invalid_account_number, suspicious_activity, too_many_attempts, processing_issue, issue_reading_card, not_supported, general_reject, general_adjustment, payment_stopped"Undocumented"messagevalueprocessing, authorized, processed, declined, rejected, voided, adjustednotesFor complete transaction field documentation, see the Transaction API Reference.
Next Steps
Enhance your payment operations with voids and refunds
Handle Payment Lifecycle
Process payments with the Payment API, implement Two-Step Processing to authorize and capture payments separately, and receive real-time updates via Webhook Events for void and refund operations.
Manage Failed Payments
Handle Payment Declines for real-time payment failures, manage Bank Rejects for asynchronous ACH rejections, and resolve Disputes to handle customer disputes and chargebacks.
Track and Reconcile Payments
Monitor payment metrics with Reporting Overview, query and analyze transaction data using Build Report Queries, and match bank statements with Bank Reconciliation.
Related articles
- Payment API - Process payments
- Payment Processing - Payment lifecycle
- Transactions API Reference
- Webhooks - Transaction events