Skip to main content

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:

PRODUCCIÓNhttps://developers.gosocket.net/api/v1/Document/GetDocument
SANDBOXhttps://developers-sbx.gosocket.net/api/v1/Document/GetDocument
info

Keep 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)
ParameterTypeDescriptionAllowed values
GlobalDocumentIdStringDocument 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
CountryDocumentIdStringFiscal identifier of the document at the country level, also known as CUFE, CLAVE, UUID, IDSee table Country Document ID Structure
ExternalIdStringDocument ID in the external system
Country*StringCountry code of the document's issuancear, bo, br, cl, co, cr, ec, gt, mx, pa, pe, py, do, sv, uy
DateFrom*StringIssuance 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*StringIssuance 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
ReceivedDateFromStringReception date (from); combining 2 or more years in the range is not allowed. This parameter filters by date, not by time.yyyy-mm-dd
ReceivedDateToStringReception 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*StringIssuer's Fiscal ID. Mandatory field. If not sent, the Unautorized Action / company not authorized error is issuedSee table Fiscal ID Structure
ReceiverCodeStringReceiver's Fiscal IDSee table Fiscal ID Structure
DocumentTypeIdIntegerDocument type code in Gosocket (invoice, note, etc.)1, 2, 3, 4, …
SeriesStringDocument series
NumberStringDocument folio
SeriesNumberStringDocument series and folio concatenated
TwoCheckStatusSenderIntegerIssuer statuses with additional Smart Supply validations0: pending 2: sent 3: accepted 4: rejected
TwoCheckStatusReceiverIntegerReceiver statuses with additional Smart Supply validations0: pending 2: sent 3: accepted 4: rejected
Has OfferBooleanDocument offer statusTrue: Has offers False: Has no offers
OfferFinancialEntityCodeStringTax ID of the company that made the offer00000000-0
DocumentTagValuesStringTags contained in the documentExample: "DocumentTagValues": { "AuthorityStatus": "2" }
ContainDocumentTagCodeBooleanIndicator that the document contains the defined tagTrue: the document contains the defined tag code. False: the document does not contain the defined tag code. Example: "ContainDocumentTagCode": { "AttRC": true }
ResultMaxItemCountIntegerNumber 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
ContinuationTokenStringToken that paginates the result if not all documents were returned in the previous queryExample: [{"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

image-20240502-224706.png

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

For this method we use Postman's Body tab.

  1. Select the method type. In this case, you must select POST.
  2. Enter the method URL.
  3. Enter the parameters shown in the previous table with their corresponding values.
  4. Press Send.
GetDocument (request)
ParameterTypeDescriptionAllowed values
GlobalDocumentIdStringDocument 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
CountryDocumentIdStringFiscal identifier of the document at the country level, also known as CUFE, CLAVE, UUID, IDSee table Country Document ID Structure
ExternalIdStringDocument ID in the external system
Country*StringCountry code of the document's issuancear, bo, br, cl, co, cr, ec, gt, mx, pa, pe, py, do, sv, uy
DateFrom*StringIssuance 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*StringIssuance 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
LastChangeFromStringDate 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
LastChangeToStringDate 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
ReceivedDateFromStringReception date (from); combining 2 or more years in the range is not allowed. This parameter filters by date, not by time.yyyy-mm-dd
ReceivedDateToStringReception 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*StringIssuer's Fiscal ID. Mandatory field. If not sent, the Unautorized Action / company not authorized error is issuedSee table Fiscal ID Structure
ReceiverCodeStringReceiver's Fiscal IDSee table Fiscal ID Structure
DocumentTypeIdIntegerDocument type code in Gosocket (invoice, note, etc.)1, 2, 3, 4, …
SeriesStringDocument series
NumberStringDocument folio
SeriesNumberStringDocument series and folio concatenated
TwoCheckStatusSenderIntegerIssuer statuses with additional Smart Supply validations0: pending 2: sent 3: accepted 4: rejected
TwoCheckStatusReceiverIntegerReceiver statuses with additional Smart Supply validations0: pending 2: sent 3: accepted 4: rejected
Has OfferBooleanDocument offer statusTrue: Has offers False: Has no offers
OfferFinancialEntityCodeStringTax ID of the company that made the offer00000000-0
DocumentTagValuesStringTags contained in the documentExample: "DocumentTagValues": { "AuthorityStatus": "2" }
ContainDocumentTagCodeBooleanIndicator that the document contains the defined tagTrue: the document contains the defined tag code. False: the document does not contain the defined tag code. Example: "ContainDocumentTagCode": { "AttRC": true }
ResultMaxItemCountIntegerNumber 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
ContinuationTokenStringToken that paginates the result if not all documents were returned in the previous queryExample: [{"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

image-20240503-002321.png

image-20240503-002336.png

image-20240503-002423.png

image-20240503-002442.png

image-20240503-002506.png

image-20240503-002521.png

image-20240503-002533.png


Example of querying tag values

image-20240503-005154.png

GetDocument (response)
ParameterTypeDescriptionAllowed values
UrlPdfStringDownload URL for the PDF file generated from the document"https://... "
UrlXmlStringDownload URL for the document's tax XML file"https://... "
GlobalDocumentIdStringDocument ID in Gosocket36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
CountryDocumentIdStringFiscal identifier of the document at the country level, also known as CUFE, CLAVE, UUID, IDSee table Country Document ID Structure
ExternalIdStringDocument ID in the external system
CountryIdStringCountry code of the document's issuancear, bo, br, cl, co, cr, ec, gt, mx, pa, pe, py, do, sv, uy
DateStringDocument issuance dateyyyy-mm-ddThh:mm:ss
DocumentTypeIdintegerDocument type code in Gosocket (invoice, note, etc.)1, 2, 3, 4, …
DocumentTypeNameStringName of the document type in GosocketExample: Electronic Invoice
NetAmountnumberNet amount
FreeAmountnumberAmount
TaxAmountnumberTax amount
TotalAmountnumberTotal amount
CurrencyTypeStringCurrency type code in which the document's values are expressedExample: COP
SeriesNumberStringDocument series and folio concatenated
SeriesStringDocument series
NumberintegerDocument folio in numeric format
NumberStrStringDocument folio in string format
DocumentSenderCodeStringIssuer's Fiscal IDSee table Fiscal ID Structure
DocumentSenderNameStringIssuer's name
DocumentReceiverCodeStringReceiver's Fiscal IDSee table Fiscal ID Structure
DocumentReceiverNameStringReceiver's name
DocumentFinancialOwnerCodeStringFinancier's IDSee table Fiscal ID Structure
DocumentFinancialOwnerNameStringFinancier's name
FinancialDateStringFinancing dateyyyy-mm-ddThh:mm:ss
EstimatedPaymentDateStringEstimated payment dateyyyy-mm-ddThh:mm:ss
DocumentTimeStampStringReception date in Gosocketyyyy-mm-ddThh:mm:ss
AuthorityTimeStampStringValidation date before the verifying entityyyyy-mm-ddThh:mm:ss
SyncPointStringSystem user that sent the document to Gosocket36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
DocumentTagsarrayTags contained in the documentExample: "DocumentTags": [ { "Code": "AuthorityStatus", "TimeStamp": "2022-07-29T18:04:03.3120133", "Value": "2" } ]
TwoCheckarrayResult of the additional validations of the SmartSupply moduleExample: "TwoCheck": { "TwoCheckDocumentStatus": 3, "TwoCheckDocumentStatusDescription": "ACEPTADO", "TwoCheckReceiverDocumentStatus": 3, "TwoCheckReceiverInternalDocumentStatusDescription": "ACEPTADO", "Timestamp": "2022-07-02T23:08:07.6106945Z" }
NotesarrayDocument notesExample: "Notes": [ { "Mandatory": false, "Code": "FAJ73", "Note": " Notificación: Estructura código no valida", "TimeStamp": "2022-07-02T18:29:14.6451258Z", "Source": "DIAN" } ]
OffersarrayDocument offers
FieldsarrayAdditional informationExample: "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" } ]
AuthorStringUser who created the documentnull or email
ContinuationTokenStringToken to paginate the result if not all documents were returned in the query performedExample: [{"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)
CodeDescriptionPossible values
AuthorityStatusStatus before the tax authority00: To be sent 01: Sent 02: Approved (Validated) 03: Rejected 04: Cancelled
AuthorityFormatVersionXML format version for the tax authority2.1 4.0 4.3
ACDCommercial Acceptance or RejectionA: Accepted R: Rejected
ARRAcknowledgment of ReceiptRF: FE Acknowledgment of Receipt ER: Shipment Rejected
ARMGoods receiptRM: Received
AttSCHas attachments for the issuert: True
AttRCHas attachments for the receivert: True
AuditContains audit informationt: True
PaymentIndicates whether the document is paidMPP: Marked as Partial Payment MTP: Marked as Full Payment
DivisionDivision or group the document belongs to
subdivisionSubdivision or subgroup the document belongs to
BranchOfficeDocument's cost center
FinancedIndicates whether the document is financed or advanced
TradeShiftTxIdID returned by TradeShift when sending the document
DistributionReceiver, DistributionSender, DistributionIndicates the document's distributionSD: 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)
StatusDescription
0Pending
2Sent
3Accepted
4Rejected
  • 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