# Document filters
There are three places where documents can exist:
- Draft documents. A document can be created before sending in a documents folder (GetDocuments).
- A document can be send and placed in the Outbox (GetOutboxDocuments).
- A document can be received in a Inbox (GetInboxDocuments).
The call’s GetDocuments, GetOutboxDocuments and GetInboxDocuments can select documents with the following criteria:
Fieldname | Description |
---|---|
ExternalId | Unique Id returned during delivery or sending of a document. Applies to inbox and outbox. Used within the search returns only the document information about the document and not the document. This will not count as a download of the document. |
DocumentId | Unique Id returned during creation of a document. Applies to the draft documents folder. |
Subject | Subject of the document. |
CreatedOn | Date range for selection of creation date. With the creation date you can retrieve the new documents created after the last document retrieved. The date is in XML DateTime. |
ModifiedOn | Date range for selection of modification date. The modification date is used to identify the document that are changed. A important change is the Status change. The date is in XML DateTime. |
Sender | Sender of the documents. Name or E-invoicing routing Id. This field is only filled for documents send or received. |
Receiver | Receiver of the documents. Name or E-invoicing routing Id. This field is only filled for documents send or received. |
Template | A template identifies the type of the document. Standard is Template/MasterId. Template/Id is only used in specific cases. |
Status | Status of the document. The possible statuses depend on the Template that is used. Name or Code can be used. The best way is to only use the Code. |
# Example New invoices since the last check
- Determine the highest CreatedOn value of the last document list and this in From.
- Be sure the paging of results is implemented, to avoid missing documents.
- Use the invoice templateId to avoid receiving other kinds of documents.
<Search>
<CreatedOn>
<From>2016-11-01T01:01:01.0000000+00:00</From>
</CreatedOn>
<Template>
<MasterId>GLDT9223370666504283001RA000000006DTP2000001</MasterId>
</Template>
</Search>