Document Cursor and Incremental Sync
To keep your ERP in step with Expressoft, you read the documents that are new since your last sync. The API has three tools for it.
Tool | Use it to |
|---|---|
dateBegin and dateEnd | Read the documents of a period. |
nOK | Read the documents marked as NOK. |
The document cursor | Keep the position of your sync in Expressoft, per document type. |
lastModifiedOnGreaterThen | Read only the products changed after a date (Products). |
Read the cursors
Query
query GetDocumentCursors {
miscellaneous {
cursor {
accountingDocumentType
accountingDynamicEntityType
dynamicEntityKey
cursorValue
cursorData
}
}
}cURL
curl --location 'https://sandbox.expressoft.eu/connect/api/interopgql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{"query": "query GetDocumentCursors { miscellaneous { cursor { accountingDocumentType accountingDynamicEntityType dynamicEntityKey cursorValue cursorData } } }"}'Response
{
"data": {
"miscellaneous": {
"cursor": [
{
"accountingDocumentType": "PurchaseInvoice",
"accountingDynamicEntityType": null,
"dynamicEntityKey": null,
"cursorValue": "<cursor value>",
"cursorData": "<cursor data>"
}
]
}
}
}There is one cursor for each accountingDocumentType: PurchaseInvoice, Transfer, ConsumptionNote, ProductionNote, InventoryAdjustment, SaleInvoice, BusinessDaySaleInvoice, BusinessDay, PMSSaleInvoice, PMSBusinessDay, Unknown. A cursor can also belong to one entity (accountingDynamicEntityType: ProductCategory, Product, Location, Warehouse, PMSPropertyCode, with its dynamicEntityKey).
Change a cursor
Query
mutation ChangeDocumentCursor($payload: DocumentCursorInputType!) {
miscellaneous {
changeDocumentCursor(payload: $payload) {
accountingDocumentType
accountingDynamicEntityType
dynamicEntityKey
cursorValue
cursorData
}
}
}Variables
{
"payload": {
"accountingDocumentType": "PurchaseInvoice",
"cursorValue": "<cursor value>"
}
}cURL
curl --location 'https://sandbox.expressoft.eu/connect/api/interopgql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{"query": "mutation ChangeDocumentCursor($payload: DocumentCursorInputType!) { miscellaneous { changeDocumentCursor(payload: $payload) { accountingDocumentType accountingDynamicEntityType dynamicEntityKey cursorValue cursorData } } }", "variables": {"payload": {"accountingDocumentType": "PurchaseInvoice", "cursorValue": "<cursor value>"}}}'Response
{
"data": {
"miscellaneous": {
"changeDocumentCursor": {
"accountingDocumentType": "PurchaseInvoice",
"accountingDynamicEntityType": null,
"dynamicEntityKey": null,
"cursorValue": "<cursor value>",
"cursorData": "<cursor data>"
}
}
}
}Field | Type | Required |
|---|---|---|
accountingDocumentType | AccountingDocumentType! | yes |
cursorValue | String! | yes |
accountingDynamicEntityType | AccountingDynamicEntityType | no |
dynamicEntityKey | String | no |