Skip to main content

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:

PRODUCTIONhttps://developers.gosocket.net/api/v1/File/DownloadDocumentXml
SANDBOXhttps://developers-sbx.gosocket.net/api/v1/File/DownloadDocumentXml

How does the DownloadDocumentXml method work?

To make the request, the method has the following parameters:

DownloadDocumentXml (request)
ParameterTypeDescriptionAllowed values
globalDocumentId*StringDocument identification in Gosocket.36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
typeStringType of XML to downloadSee the Types of files to download table

*Required

Types of Files to Download
TypeDescriptionCountries where it applies
originalFiscal (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
defaultGosocket XML: XML that is stored in Inbox, includes the custom fieldsAll
responseTax Authority Response: File with the Tax Authority's response for the issued document.All
smartsupplySmart Supply XML: XML that includes the fields related to the SS functionality.All countries where SS is implemented
distributionDistribution XML: XML that is distributed mandatorilyCO
addendaCommercial Addenda XML: XML with the Addenda nodeMX
integrationIntegration JSON file: File with the request sent to the API for issuing the documentAll

Request example

image-20240503-011727.png

Note: Remember that before using the method, you must authenticate within the Authorization tab.

For this method, we use the Postman Params tab.

  1. Select the method type. In this case, you must select GET.
  2. Enter the method's URL.
  3. Enter the parameters shown in the table above with their corresponding values.
  4. Press Send.

Response example for downloading the Default XML (Gosocket)

image-20240503-011937.png

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

image-20240503-012004.png


Response example for downloading the distribution XML

image-20240503-012044.png

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

image-20240503-012118.png


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

image-20240503-012150.png

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

image-20240503-012246.png

Note: Unlike the other XML types, it does not contain custom fields.


Response example for downloading the Smart Supply XML

image-20240503-012713.png

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

image-20240503-012859.png


Response parameters

DownloadDocumentXml (response)
ParameterTypeDescriptionAllowed values
NameStringName of the downloaded XML fileglobalDocumentId.xml
DescriptionStringDescription of the event performed.Xml Content for GlobalDocumentId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Base64ContentStringBase64-encoded XML file
TimeStampStringDate and time the document was createdyyyy-mm-ddThh:mm:ss
TypeStringFile type"xml"

Method characteristics

  • When the document Id (globalDocumentId) does not exist, the system responds with an error message:

    image-20240503-013410.png

  • 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.