Method for querying document status and metadata (GetDocument)
This method allows you to query a document's information using the POST GetDocument service.
Using this method, you obtain all the document's information: document IDs, issuance and signing dates, notes, issuer and receiver data, status, etc.
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/GetDocumenthttps://developers-sbx.gosocket.net/api/v1/Document/GetDocumentKeep the following in mind:
- The maximum date range for documents is one month.
- The API will respond with 10 documents per query.
- Enter the "ResultMaxItemCount" parameter to query up to 100 documents. For example, if you need to query 80 documents, you should enter:
"ResultMaxItemCount": 80. - The parameters (DateFrom and DateTo) used to indicate the period to query can be omitted in the sandbox environment. However, their use is mandatory, as indicated in this documentation.
How does the GetDocument method work?
To make the request, the method has the following parameters in JSON format with the following structure:
| GetDocument (request) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| GlobalDocumentId | String | Document ID in Gosocket. Although this parameter is not mandatory, it speeds up the query when filled in. | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| CountryDocumentId | String | Fiscal identifier of the document at the country level, also known as CUFE, CLAVE, UUID, ID | See table Country Document ID Structure |
| ExternalId | String | Document ID in the external system | |
| Country* | String | Country code of the document's issuance | ar, bo, br, cl, co, cr, ec, gt, mx, pa, pe, py, do, sv, uy |
| DateFrom* | String | Issuance date (from); combining 2 or more years in the range is not allowed. Mandatory field, except when GlobalDocumetId is provided. This parameter filters by date, not by time. | yyyy-mm-dd |
| DateTo* | String | Issuance date (to); combining 2 or more years in the range is not allowed. Mandatory field, except when GlobalDocumetId is provided. This parameter filters by date, not by time. | yyyy-mm-dd |
| ReceivedDateFrom | String | Reception date (from); combining 2 or more years in the range is not allowed. This parameter filters by date, not by time. | yyyy-mm-dd |
| ReceivedDateTo | String | Reception date (to); combining 2 or more years in the range is not allowed. This parameter filters by date, not by time. | yyyy-mm-dd |
| SenderCode* | String | Issuer's Fiscal ID. Mandatory field. If not sent, the Unautorized Action / company not authorized error is issued | See table Fiscal ID Structure |
| ReceiverCode | String | Receiver's Fiscal ID | See table Fiscal ID Structure |
| DocumentTypeId | Integer | Document type code in Gosocket (invoice, note, etc.) | 1, 2, 3, 4, … |
| Series | String | Document series | |
| Number | String | Document folio | |
| SeriesNumber | String | Document series and folio concatenated | |
| TwoCheckStatusSender | Integer | Issuer statuses with additional Smart Supply validations | 0: pending 2: sent 3: accepted 4: rejected |
| TwoCheckStatusReceiver | Integer | Receiver statuses with additional Smart Supply validations | 0: pending 2: sent 3: accepted 4: rejected |
| Has Offer | Boolean | Document offer status | True: Has offers False: Has no offers |
| OfferFinancialEntityCode | String | Tax ID of the company that made the offer | 00000000-0 |
| DocumentTagValues | String | Tags contained in the document | Example: "DocumentTagValues": { "AuthorityStatus": "2" } |
| ContainDocumentTagCode | Boolean | Indicator that the document contains the defined tag | True: the document contains the defined tag code. False: the document does not contain the defined tag code. Example: "ContainDocumentTagCode": { "AttRC": true } |
| ResultMaxItemCount | Integer | Number of query results; if a value above 100 is set, the system will cap it at 100 max. | 1, 2, 3, 4, 5, 6, 7, 8, 9…100 |
| ContinuationToken | String | Token that paginates the result if not all documents were returned in the previous query | Example: [{"compositeToken":{"token":null,"range":{"min":"05C1E0","max":"05C1E2"}},"orderByItems":[{"item":"2022-07-29T23:04:03.3120133Z"}],"rid":"2nsFAKt-OBYtwgQAAACACQ==","skipCount":0,"filter":null}] |
*Required
Note: The parameters (DateFrom and DateTo) used to indicate the period to query can be omitted in the sandbox environment. However, their use is mandatory, as indicated in this manual.
Method request example

Note: Remember that before using the method, you must authenticate in the Authorization tab.
For this method we use Postman's Body tab.
- Select the method type. In this case, you must select POST.
- Enter the method URL.
- Enter the parameters shown in the previous table with their corresponding values.
- Press Send.
| GetDocument (request) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| GlobalDocumentId | String | Document ID in Gosocket. Although this parameter is not mandatory, it speeds up the query when filled in. | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| CountryDocumentId | String | Fiscal identifier of the document at the country level, also known as CUFE, CLAVE, UUID, ID | See table Country Document ID Structure |
| ExternalId | String | Document ID in the external system | |
| Country* | String | Country code of the document's issuance | ar, bo, br, cl, co, cr, ec, gt, mx, pa, pe, py, do, sv, uy |
| DateFrom* | String | Issuance date (from); combining 2 or more years in the range is not allowed. Mandatory field, except when GlobalDocumetId is provided. This parameter filters by date, not by time. | yyyy-mm-dd |
| DateTo* | String | Issuance date (to); combining 2 or more years in the range is not allowed. Mandatory field, except when GlobalDocumetId is provided. This parameter filters by date, not by time. | yyyy-mm-dd |
| LastChangeFrom | String | Date of last change (from); combining 2 or more years in the range is not allowed. This parameter filters by date, not by time. | yyyy-mm-dd |
| LastChangeTo | String | Date of last change (to); combining 2 or more years in the range is not allowed. This parameter filters by date, not by time. | yyyy-mm-dd |
| ReceivedDateFrom | String | Reception date (from); combining 2 or more years in the range is not allowed. This parameter filters by date, not by time. | yyyy-mm-dd |
| ReceivedDateTo | String | Reception date (to); combining 2 or more years in the range is not allowed. This parameter filters by date, not by time. | yyyy-mm-dd |
| SenderCode* | String | Issuer's Fiscal ID. Mandatory field. If not sent, the Unautorized Action / company not authorized error is issued | See table Fiscal ID Structure |
| ReceiverCode | String | Receiver's Fiscal ID | See table Fiscal ID Structure |
| DocumentTypeId | Integer | Document type code in Gosocket (invoice, note, etc.) | 1, 2, 3, 4, … |
| Series | String | Document series | |
| Number | String | Document folio | |
| SeriesNumber | String | Document series and folio concatenated | |
| TwoCheckStatusSender | Integer | Issuer statuses with additional Smart Supply validations | 0: pending 2: sent 3: accepted 4: rejected |
| TwoCheckStatusReceiver | Integer | Receiver statuses with additional Smart Supply validations | 0: pending 2: sent 3: accepted 4: rejected |
| Has Offer | Boolean | Document offer status | True: Has offers False: Has no offers |
| OfferFinancialEntityCode | String | Tax ID of the company that made the offer | 00000000-0 |
| DocumentTagValues | String | Tags contained in the document | Example: "DocumentTagValues": { "AuthorityStatus": "2" } |
| ContainDocumentTagCode | Boolean | Indicator that the document contains the defined tag | True: the document contains the defined tag code. False: the document does not contain the defined tag code. Example: "ContainDocumentTagCode": { "AttRC": true } |
| ResultMaxItemCount | Integer | Number of query results; if a value above 100 is set, the system will cap it at 100 max. | 1, 2, 3, 4, 5, 6, 7, 8, 9…100 |
| ContinuationToken | String | Token that paginates the result if not all documents were returned in the previous query | Example: [{"compositeToken":{"token":null,"range":{"min":"05C1E0","max":"05C1E2"}},"orderByItems":[{"item":"2022-07-29T23:04:03.3120133Z"}],"rid":"2nsFAKt-OBYtwgQAAACACQ==","skipCount":0,"filter":null}] |
*Required
Response example







Example of querying tag values

| GetDocument (response) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| UrlPdf | String | Download URL for the PDF file generated from the document | "https://... " |
| UrlXml | String | Download URL for the document's tax XML file | "https://... " |
| GlobalDocumentId | String | Document ID in Gosocket | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| CountryDocumentId | String | Fiscal identifier of the document at the country level, also known as CUFE, CLAVE, UUID, ID | See table Country Document ID Structure |
| ExternalId | String | Document ID in the external system | |
| CountryId | String | Country code of the document's issuance | ar, bo, br, cl, co, cr, ec, gt, mx, pa, pe, py, do, sv, uy |
| Date | String | Document issuance date | yyyy-mm-ddThh:mm:ss |
| DocumentTypeId | integer | Document type code in Gosocket (invoice, note, etc.) | 1, 2, 3, 4, … |
| DocumentTypeName | String | Name of the document type in Gosocket | Example: Electronic Invoice |
| NetAmount | number | Net amount | |
| FreeAmount | number | Amount | |
| TaxAmount | number | Tax amount | |
| TotalAmount | number | Total amount | |
| CurrencyType | String | Currency type code in which the document's values are expressed | Example: COP |
| SeriesNumber | String | Document series and folio concatenated | |
| Series | String | Document series | |
| Number | integer | Document folio in numeric format | |
| NumberStr | String | Document folio in string format | |
| DocumentSenderCode | String | Issuer's Fiscal ID | See table Fiscal ID Structure |
| DocumentSenderName | String | Issuer's name | |
| DocumentReceiverCode | String | Receiver's Fiscal ID | See table Fiscal ID Structure |
| DocumentReceiverName | String | Receiver's name | |
| DocumentFinancialOwnerCode | String | Financier's ID | See table Fiscal ID Structure |
| DocumentFinancialOwnerName | String | Financier's name | |
| FinancialDate | String | Financing date | yyyy-mm-ddThh:mm:ss |
| EstimatedPaymentDate | String | Estimated payment date | yyyy-mm-ddThh:mm:ss |
| DocumentTimeStamp | String | Reception date in Gosocket | yyyy-mm-ddThh:mm:ss |
| AuthorityTimeStamp | String | Validation date before the verifying entity | yyyy-mm-ddThh:mm:ss |
| SyncPoint | String | System user that sent the document to Gosocket | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| DocumentTags | array | Tags contained in the document | Example: "DocumentTags": [ { "Code": "AuthorityStatus", "TimeStamp": "2022-07-29T18:04:03.3120133", "Value": "2" } ] |
| TwoCheck | array | Result of the additional validations of the SmartSupply module | Example: "TwoCheck": { "TwoCheckDocumentStatus": 3, "TwoCheckDocumentStatusDescription": "ACEPTADO", "TwoCheckReceiverDocumentStatus": 3, "TwoCheckReceiverInternalDocumentStatusDescription": "ACEPTADO", "Timestamp": "2022-07-02T23:08:07.6106945Z" } |
| Notes | array | Document notes | Example: "Notes": [ { "Mandatory": false, "Code": "FAJ73", "Note": " Notificación: Estructura código no valida", "TimeStamp": "2022-07-02T18:29:14.6451258Z", "Source": "DIAN" } ] |
| Offers | array | Document offers | |
| Fields | array | Additional information | Example: "Fields": [ { "Code": "ORDENINTERNA", "Name": "Orden Interna", "Value": "COCCRPPE02", "ExternalId": "46a0810c-cbbe-44bd-8b38-7f736a416952", "Source": "ARESTREPO@GEO-PARK.COM", "IsValid": true, "EditingEnabled": false, "Flow": "smartsupply", "Timestamp": "2022-07-29T22:26:06.7719072Z", "Category": "Orden interna" } ] |
| Author | String | User who created the document | null or email |
| ContinuationToken | String | Token to paginate the result if not all documents were returned in the query performed | Example: [{"compositeToken":{"token":null,"range":{"min":"05C1E0","max":"05C1E2"}},"orderByItems":[{"item":"2022-07-29T23:04:03.3120133Z"}],"rid":"2nsFAKt-OBYtwgQAAACACQ==","skipCount":0,"filter":null}] |
Note: The XML and PDF file download URLs are activated per company. Therefore, to be able to view them, their activation must be requested.
Method characteristics
- The method retrieves the document's information.
- It can be queried as many times as required.
- When no information is found with the query parameters, the service responds:
{
"Documents": [],
"ContinuationToken": null
}- When not querying by a specific document Id, the maximum number of documents the query returns is 10 documents.
- The statuses the document has gone through can be seen in the DocumentTags section
| DocumentTags values (GetDocument) | ||
|---|---|---|
| Code | Description | Possible values |
| AuthorityStatus | Status before the tax authority | 00: To be sent 01: Sent 02: Approved (Validated) 03: Rejected 04: Cancelled |
| AuthorityFormatVersion | XML format version for the tax authority | 2.1 4.0 4.3 |
| ACD | Commercial Acceptance or Rejection | A: Accepted R: Rejected |
| ARR | Acknowledgment of Receipt | RF: FE Acknowledgment of Receipt ER: Shipment Rejected |
| ARM | Goods receipt | RM: Received |
| AttSC | Has attachments for the issuer | t: True |
| AttRC | Has attachments for the receiver | t: True |
| Audit | Contains audit information | t: True |
| Payment | Indicates whether the document is paid | MPP: Marked as Partial Payment MTP: Marked as Full Payment |
| Division | Division or group the document belongs to | |
| subdivision | Subdivision or subgroup the document belongs to | |
| BranchOffice | Document's cost center | |
| Financed | Indicates whether the document is financed or advanced | |
| TradeShiftTxId | ID returned by TradeShift when sending the document | |
| DistributionReceiver, DistributionSender, Distribution | Indicates the document's distribution | SD: No Distribution Rules PD: Partially Distributed ED: Distribution Error TD: Distributed |
In the TwoCheck section you can see the result of the SmartSupply process validations:
| TwoCheck values (GetDocument) | |
|---|---|
| Status | Description |
| 0 | Pending |
| 2 | Sent |
| 3 | Accepted |
| 4 | Rejected |
-
In the Notes section you can see the notes associated with the document, which can come from different sources:
- Tax Authority (DIAN, SII, SRI, SUNAT, PAC)
- Commercial Events
- Mail server
- Distribution mail server
- Distribution via Ftp/Sftp
- SmartSupply
- Gosocket