Overview
Proper error handling is crucial for creating reliable payment integrations. Localpayment uses a consistent error structure across all API endpoints to help you quickly identify and resolve issues.Standardized Codes
Consistent error codes across all API endpoints and payment methods
Detailed Messages
Human-readable descriptions with specific error details
Best Practices
Proven strategies for handling errors in production environments
HTTP Response Codes
Localpayment utilizes standard HTTP status codes to indicate the success or failure of API requests:Error Response Structure
When an error occurs, Localpayment returns a JSON object with detailed error information:Error Response Fields
Internal Status Codes Reference
While Localpayment uses standard HTTP codes for request-level status, thestatus.code and errors[].code fields provide granular business logic and processing status.
Common Error Scenarios
Authentication Errors
SolutionCheck your API credentials and ensure your access token is valid. Use the token refresh endpoint if needed.
Validation Errors
SolutionReview the
errors array for specific field validation issues. Check API documentation for required fields and format specifications.Business Logic Errors
SolutionThese errors require business-level resolution. Check account balances, transaction limits, or contact support for specific restrictions.
Best Practices for Error Handling
Pro TipImplement structured logging from day one. Include correlation IDs, error codes, and context information to make debugging much easier when issues occur in production.
1. Implement Comprehensive Logging
2. User-Friendly Error Messages
Create a mapping from technical error codes to user-friendly messages:3. Retry Mechanism with Exponential Backoff
4. Circuit Breaker Pattern
Implement a circuit breaker to prevent cascading failures:Next Steps
API Reference
Complete list of error codes with detailed explanations
Testing Guide
Learn how to test error scenarios in sandbox
Support Contact
Get help with specific error scenarios

