Before You Begin
Ensure you have:API Credentials
Valid API credentials and access token for authentication.
Account Setup
Proper account setup for your target country and business verification.
IP Whitelisting
Whitelist your server IP addresses for API access.
Webhook Endpoint
Set up a webhook URL to receive payment notifications.
Additional Refund Requirements:
- Sufficient balance in your Localpayment account to cover the refund amount.
- User role with refund permissions (see User Roles documentation).
- The original transaction must be in
Completedstatus. - The
externalIdof the original payment transaction.
Implementation Guide
Localpayment provides two methods for processing virtual account refunds: API integration for automated processing and Business Portal for manual operations.API Refund Processing
Programmatically process refunds through REST API for automated workflows and integration with your systems.
Business Portal Refund Processing
Manually process refunds through the Localpayment Business Portal with a user-friendly interface.
Direct Refunds for Virtual Accounts
All virtual account refunds are processed as Direct Refunds, meaning you only need the original transaction’sexternalId. The system automatically routes funds back to the original payer’s account without requiring additional beneficiary information.
Country-Specific Requirements
Virtual account refunds have specific requirements and limitations depending on the country and banking method. Below are the key country-specific considerations:- Mexico
- Banco Azteca: Refunds are not currently available for payments processed through Banco Azteca in Mexico.
- SPEI/TEF: All refunds for payments made via SPEI or TEF are processed through the SPEI network.
Step 1: Process Refund via API
To refund a virtual account payment through API, send aPATCH request to the Refund endpoint.
Key Request Parameters
The request requires several key parameters:Example Request
Below is an example usingcurl:
curl
Step 2: Handle the Response
Successful Response
A successfully processed refund returns confirmation details:Key Response Fields
Error Response
When a refund request fails, you’ll receive error information:Common Error Scenarios
Business Portal Refunds
Virtual account refunds can also be processed through the Localpayment Business Portal interface. This method provides a visual workflow for managing refunds and is particularly useful for:- Occasional refunds that don’t require API automation.
- Administrative oversight where approval workflows are needed.
- Quick refund processing without development resources.
Step 3: Track Refund Status
After initiating a refund, monitor its progress through these methods:Webhooks (Recommended)
Receive real-time notifications when transaction status changes. Most efficient for production environments.
Status API Endpoint
Query transaction status programmatically. Useful for polling or recovering lost webhook notifications.
Business Portal View
Visual interface for monitoring transactions. Great for manual oversight and detailed transaction analysis.
Common Refund Status Codes
Complete ReferenceView all status codes in our Transaction Status Documentation.
Testing Your Integration
Test Scenarios
Verify your integration handles these scenarios:- Successful Refund: Process refund with valid
externalIdand sufficient funds. - Insufficient Funds: Attempt refund with inadequate account balance.
- Invalid Transaction: Try to refund non-existent
externalId. - Duplicate Refund: Attempt to refund already refunded transaction.
- Permission Validation: Test with users having different permission levels.
Next Steps
View transaction status
Check the current status of transactions and refunds using the Transaction
Status API.
Configure webhooks
Set up webhooks to receive real-time notifications for refund status
changes.
Review user roles
Manage user permissions and roles for refund processing capabilities.

