Record source
Introduction
The record source contains information of the origin of the record. This is useful information at different times where you might, for example, want to have different logic depending on record origin. That means you will always have access to read from where a specific record originates. This concept is applied primarily to all record types related to sales, like;
- Order
- Invoice
- Settlement Report
- Z Report
This source field exists on all record types where there is a distinct remote system responsible for creating the record in the Integration Platform. An Order for example can only be created from one remote system (a sale can only happen in one single place), unlike Product (sku) which can exist in multiple remote systems.
Read more in the Tenant Swagger API reference documentation.
Source
A record can have one single source indicating where the object originated from. The source contains some key components including:
type
- The entity type which created the record i.e. connection, automatic, user.
connectionType
- The fixed unique Connector type within the platform.
connectionId
- The fixed unique Connector id within the platform.
code
- The sub source in the remote system. Has value depending on the remote system and if it has such a concept. Same goes for values this field might have, that depends on the remote system.
connectionName
- The name of the Connection as defined by the user on the Tenant.
Sub source
A more detailed grouping of sources in the remote system. The source
field indicates from which remote system the record originated whereas the code
indicates the possible underlying channel from which the remote system got the record from. For more info see source->code
above.
Example record source scenario
Let’s consider an example scenario where an Order has been imported from an external e-commerce website into the Integration Platform. We will then see the source
field and can from that derive information that might be of value.
In this example we can also see the usage of code
(aka sub source) where the order was placed in that e-commerce through the mobile sales channel.
{
"source": {
"type": "connection",
"connectionType": "ecomx",
"connectionId": "000162cd952888b5508514310ddf0088",
"code": "mobile",
"connectionName": "E-commerce platform X"
}
}
Let’s consider a similar example but when the Order was placed through the PoS channel in the same system and Connection.
{
"source": {
"type": "connection",
"connectionType": "ecomx",
"connectionId": "000162cd952888b5508514310ddf0088",
"code": "pos",
"connectionName": "E-commerce platform X"
}
}