The Spanish version is the authoritative reference. View in Spanish
Method to download the XML file (DownloadDocumentXml)
This method allows you to download a document's XML file using the GET DownloadDocumentXml service.
Through this method, you obtain the base64-encoded XML file of the queried document.
To connect to this functionality, you will need to enter the URL according to the environment you want to use:
https://developers.gosocket.net/api/v1/File/DownloadDocumentXmlhttps://developers-sbx.gosocket.net/api/v1/File/DownloadDocumentXmlHow does the DownloadDocumentXml method work?
To make the request, the method has the following parameters:
| DownloadDocumentXml (request) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| globalDocumentId* | String | Document identification in Gosocket. | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| type | String | Type of XML to download | See the Types of files to download table |
*Required
| Types of Files to Download | ||
|---|---|---|
| Type | Description | Countries where it applies |
| original | Fiscal (Tax) XML: XML sent to the Tax Authority. Only includes the custom fields in the countries where the Authority supports them within the XML. | AR, BO, CO, CR, DO, EC, PA, PE, PY, UY |
| default | Gosocket XML: XML that is stored in Inbox, includes the custom fields | All |
| response | Tax Authority Response: File with the Tax Authority's response for the issued document. | All |
| smartsupply | Smart Supply XML: XML that includes the fields related to the SS functionality. | All countries where SS is implemented |
| distribution | Distribution XML: XML that is distributed mandatorily | CO |
| addenda | Commercial Addenda XML: XML with the Addenda node | MX |
| integration | Integration JSON file: File with the request sent to the API for issuing the document | All |
Request example

Note: Remember that before using the method, you must authenticate within the Authorization tab.
For this method, we use the Postman Params tab.
- Select the method type. In this case, you must select GET.
- Enter the method's URL.
- Enter the parameters shown in the table above with their corresponding values.
- Press Send.
Response example for downloading the Default XML (Gosocket)

You can convert the response of the Base64Content parameter, whose result, for this example, is as follows:

Response example for downloading the distribution XML

You can convert the response of the Base64Content parameter, whose result, for this example, is as follows:

Response example for downloading the original XML (Tax Authority XML)

You can convert the response of the Base64Content parameter, whose result, for this example, is as follows:

Note: Unlike the other XML types, it does not contain custom fields.
Response example for downloading the Smart Supply XML

You can convert the response of the Base64Content parameter, whose result, for this example, is as follows:

Response parameters
| DownloadDocumentXml (response) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| Name | String | Name of the downloaded XML file | globalDocumentId.xml |
| Description | String | Description of the event performed. | Xml Content for GlobalDocumentId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| Base64Content | String | Base64-encoded XML file | |
| TimeStamp | String | Date and time the document was created | yyyy-mm-ddThh:mm:ss |
| Type | String | File type | "xml" |
Method characteristics
-
When the document Id (globalDocumentId) does not exist, the system responds with an error message:

-
The file can be downloaded as many times as necessary.
-
When the type parameter is not specified, or a value outside the list is entered, the API responds with the default type XML.
-
The distribution XML has double encoding, so it will need to be decoded twice.