Overview
The submission process:- Convert signed XML to Base64 encoding
- Send to SRI’s SOAP web service endpoint
- Receive validation response
- Handle success or error states
SRI operates two environments: Testing (ambiente “1”) and Production (ambiente “2”). Always test in the testing environment first.
SRI Endpoints
SRI provides different endpoints for testing and production:Testing Environment
Production Environment
Submitting Documents
Submit the signed XML
Call The function automatically:
documentReception() with your signed XML and the reception URL:- Converts the XML to Base64
- Creates a SOAP client
- Calls the
validarComprobanteweb service method - Returns the validation result
Response Structure
ThedocumentReception() function returns a SOAP response with this structure:
Success Response
Error Response
Common Response States
| State | Description | Next Steps |
|---|---|---|
RECIBIDA | Document received and validated | Proceed to authorization |
DEVUELTA | Document rejected due to errors | Fix errors and resubmit |
Error Handling
Implement proper error handling for submission failures:Complete Example
Best Practices
Use environment-specific endpoints
Use environment-specific endpoints
Always use testing endpoints during development and only switch to production when ready.
Store and log access keys
Store and log access keys
Always store the access key with your invoice record for future reference and authorization checks.
Implement retry logic
Implement retry logic
Network issues can cause temporary failures. Implement retry logic with exponential backoff.
Validate before submission
Validate before submission
Ensure your invoice data is valid before attempting to sign and submit.
Next Steps
Authorize Documents
Check authorization status after successful reception
Complete Workflow
See the full end-to-end process
API Reference
documentReception
View complete API documentation for document reception