Overview
ThedocumentReception function submits XML documents to the SRI (Servicio de Rentas Internas) for validation and reception. This is the first step in the electronic invoicing process.
Function Signature
Parameters
The XML document as a string. This will be automatically converted to base64 encoding before being sent to the SRI.
The SRI SOAP endpoint URL for document reception. Use the testing or production URL depending on your environment.
SRI Endpoints
Testing Environment
Production Environment
Return Value
The response from the SRI’s
validarComprobante SOAP method, containing validation results and reception status.Usage Example
Implementation Details
The function performs the following steps:- Converts the XML string to base64 encoding
- Creates a SOAP client using the provided reception URL
- Calls the
validarComprobanteSOAP method with the encoded XML - Returns the validation and reception result
Error Handling
The function will reject with an error if:- The SOAP client creation fails
- The
validarComprobantecall fails - Network connectivity issues occur