The Spanish version is the authoritative reference. View in Spanish
Method for viewing received documents (GetReceivedDocument)
This method allows you to view the documents received by a company using the GET GetReceivedDocument service.
Using this method, you obtain the list of received documents with a limit of 50 documents per query for the company. When there are more received documents than the query limit (50), the retrieved documents must be marked so that they do not appear again in the next query, making room for newly received documents.
Each document has an assigned ID (globalDocumentId) with which it is possible to mark it as received using the POST ConfirmReceivedDocument method, which you can see by clicking here.
Note: This method must be activated through your assigned consultant.
To connect to this functionality, you must enter the URL according to the environment you want to use:
https://developers.gosocket.net/api/v1/Document/GetReceivedDocumenthttps://developers-sbx.gosocket.net/api/v1/Document/GetReceivedDocumentHow does the GetReceivedDocument method work?
To make the request, the method has the following parameter:
accountCode
| GetReceivedDocument (request) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| AccountCode | String | Company's fiscal ID | See table Fiscal ID Structure |
Request example

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

To correctly interpret the API response, take into account the following criteria:

Characteristics of the GetReceivedDocument method
- The limit of results shown in the query is 50 documents.
- This method must be used together with the ConfirmReceivedDocument method.
- The query can be performed several times and will always give the same result until the documents are marked as received using the ConfirmReceivedDocument method.
- After marking the documents, the query will bring the received documents that are still pending to be marked.
El Salvador
For the particular case of El Salvador, an additional consideration must be taken into account, since this locality has the particularity of using the JSON format as the standard for issuing electronic documents (unlike the other locations, which use XML).
Given this, and considering this method's response (XML response), the standard Gosocket XML is returned, containing the received document's information, and a custom element includes the original (tax) JSON file in base64.
Response example
{
"Error": false,
"Description": null,
"CData": [
{
"GlobalDocumentId": "84bca6f4-eae2-18b8-44dd-70a6a5670486",
"XmlString": "<DTE version=\"DTE_v1.9\">...<campoString name=\"json\">ew0KICAiaWRlbnRpZmljYWNpb24iOiB7DQogICAgInZlcnNpb24iOiAxLA0KICAgICJhbWJpZW50ZSI6ICIwMCIsDQo...=</campoString>...</DTE>"
}
],
"Code": 200
}As you can see, the response contains an XML in which the <campoString name="json"> element includes the JSON file in base64 format.
Example of the XML content returned in XmlString:
<DTE version="DTE_v1.9">
<Documento ID="ID_1">
<Encabezado>
<IdDoc>
<Ambiente>00</Ambiente>
<Version>1</Version>
<Tipo>07</Tipo>
<Numero>000000000000001</Numero>
<FechaEmis>2023-12-05T21:13:37.00</FechaEmis>
</IdDoc>
</Encabezado>
<Detalle>
<NroLinDet>1</NroLinDet>
<DscItem>Retencion aplicada sobre la factura</DscItem>
</Detalle>
</Documento>
<Personalizados>
<DocPersonalizado>
<campoString name="json">ew0KICAiaWRlbnRpZmljYWNpb24iOiB7DQogICAgInZlcnNpb24iOiAxLA0KICAgICJhbWJpZW50ZSI6ICIwMCIsDQo...=</campoString>
</DocPersonalizado>
</Personalizados>
</DTE>