Setup
Financial Data Synchronization
In Sapera financial entries are created during booking of draft entrires. Each booking process is registered in the system as a BookingOperation entity. The synchronization flow between Sapera and Business Central for these financial entries could follow this general approach:
- Periodically check for newly booked Booking Operations.
- Each operation references a Draft property which determines the journal mapping to Business Central.
- Map Sapera drafts to BC journals (either through a maintained map or a single journal strategy).
- Fetch financial entries per booking operation using paged requests.
- Ensure involved actors are synced in BC as Customers or Vendors.
- Export financial entries to Business Central.
Get Booking Operations (Paged)
Method: POST
URL: {host_url}/api/accounting/bookingOperation/getBookingOperationsPage
Minimal request:
{
"sortInfo": [],
"offset": 0,
"count": page_size,
"includeOverallEntryCount": true
}
Optional Filters:
BookedDateFilter
: filter byBookedAt
date (used to get only new booking operations).OrganizationalUnitId
: allows to specify organizational unit which accounting metadata will be used to filter booking operations by accounting metadata. In case whenOrganizationalUnitId
is not specified, will be used as Organizational unit to the user who is logged in.
Get Financial Entries by Booking Operation (Paged)
Method: POST
URL: {host_url}/api/accounting/bookingOperation/getBookingOperationEntriesPage
Minimal request:
{
"bookingOperationId": { "value": booking_operation_id },
"sortInfo": [],
"offset": 0,
"count": page_size,
"includeOverallEntryCount": true
}
Actor Synchronization
Each financial entry in Sapera has an EntryKind
:
Financial
Debtor
Creditor
Debtor
and Creditor
entries must have their ActorId
resolved and synced in Business Central before financial entries are exported. Customers are presented in BusinessCentral as Customers
, suppliers are presented as Vendors
.
Syncing Workflow:
To synchronize customers, you need to resolve ActorInfos for all actors referenced in Debtor financial entries. The process for retrieving actor info is described in the document Get Actors. Each ActorInfo
contains an Identifiers
collection. From this collection, you must extract the customer identifier and check whether a Customer
with the same identifier already exists in Business Central. If not, the Customer
must be registered in Business Central via their API.
Similarly, to synchronize suppliers, resolve ActorInfos
for actors found in Creditor financial entries. Again, use the Identifiers collection to extract the supplier identifier and verify whether a matching Vendor
exists in Business Central. If the Vendor
does not exist, register it using the Business Central API.
To retrieve the necessary Sapera actor data for constructing these API calls, you can use the GetActorPage
method with a filter by ActorIds
. This is also covered in the Get Actors documentation.
Mapping EntryKind to BC AccountType
Sapera EntryKind | Business Central AccountType | Identifier Used for Account Number |
---|---|---|
Financial | Finanskonto | FinancialAccount number |
Debtor | Debitor | CustomerIdentifier |
Creditor | Creditor | SupplierIdentifier |
Stock Value Synchronization
Stock sync is not implemented in the Inventio.IT integration, but can be easily done using Sapera API.
To do this following API method need to be used:
Method: POST
URL: {host_url}/api/inventory/Product/GetProductPage
See: GetProductPage Usage for complete details.
Recommended Sync Flow
- Periodically call
GetProductPage
withModifiedAfter
filter to fetch products modified after a specific date (triggered by stock movements). - Use
OrganizationalUnitPropertiesRequest
in the payload:- Provide
OrganizationalUnitIds
- Set
PropertiesToLoad
to includeProductOrganizationalUnitPropertiesToLoad.Availability
- Provide
- Read returned
OrganizationalUnitProperties.Availability
field to get stock counts. - Sync this data into Business Central accordingly.