All transactional documents in the Datagate API (sales, orders, stock movements) follow a common structure. Understanding this structure is essential for any integration — whether you're reading documents from Datagate or creating them from the outside.
A document has a header (document-level data) and items (document lines — products, quantities, prices). The audit fields (who created, who modified, who validated) apply only at the header level, not on individual lines.
| Field | Meaning |
|---|---|
| documentTypeCode | Type of document — for example: sales receipt, vendor receipt, shipping to another store |
| documentSeries, documentNo, documentDate | Series, number and date. The series and number are automatically generated by Datagate and cannot be set via the API |
| Barcode | Barcode printed on the document — useful when scanning the document for receipt or returns |
| documentStatus | Document status: Draft, Validated, Canceled |
| documentReference | The reference visible on the scanner and in the interface. It must match the number physically printed on the document |
When one document is generated from another (for example, an order shipment), the source fields identify the original document:
| Field | Meaning |
|---|---|
| sourceDocumentModule | Source Module: Order, Sale, Service |
| sourceDocumentTypeCode, sourceDocumentSeries, and so on. | Full identity of the source document |
These fields allow complete traceability of the flow: from order to scan, from scan to stock movement, from stock to invoice.
One of the most useful mechanisms for integrations: free fields where the external system can store its own metadata. Values are automatically copied throughout the process flow — from Order → Scan → Stock. If you put an SAP ID on the order, you will find it on the inventory movement generated from that order.
| Field | Meaning |
|---|---|
| extraField1, extraField2 | Free text fields, available on both header and lines |
| remoteDataImportModule | Source system name (e.g. SAP, Magento, external WMS) |
| remoteDataImportID | Document ID in the source system |
| remoteLineID | Line ID in the source document |
| Field | Meaning |
|---|---|
| documentGroup, groupID, groupType, groupReferenceNo | Document grouping — useful when multiple documents belong to the same logical "folder" |
| Audit fields | Create Date, Last Changed Date, Validate Date, Canceled Date — detailed on the Versioning page |
A typical document (for example, an inventory entry) looks like this:
{
"warehouseCode": "DEP-01",
"toWarehouseCode": "MAG-03",
"partnerCode": "FURN-100",
"documentTypeCode": "EXPEDITIE",
"documentDate": "2024-03-15T08:30:00Z",
"documentReference": "EXP-2024-0042",
"remarks": "Expediție marfă comandă online #1234",
"totalQuantity": 25,
"totalAmount": 1500.00,
"totalVAT": 285.00,
"items": [
{
"lineNo": 1,
"itemCode": "SKU-A100",
"barcode": "5941234567890",
"quantity": 10,
"price": 50.00,
"priceWithVAT": 59.50,
"amount": 500.00,
"amountWithVAT": 595.00,
"extraField1": "SAP-LINE-001"
},
{
"lineNo": 2,
"itemCode": "SKU-B200",
"barcode": "5941234567891",
"quantity": 15,
"price": 66.67,
"priceWithVAT": 79.33,
"amount": 1000.00,
"amountWithVAT": 1190.00,
"lotNo": "LOT-2024-03"
}
],
"remoteDataImportModule": "SAP",
"remoteDataImportID": "SAP-DOC-98765",
"extraField1": "PROIECT-ALPHA"
}
Fields that are not relevant can be omitted or submitted as null.