Skip to main content

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:

  1. Periodically check for newly booked Booking Operations.
  2. Each operation references a Draft property which determines the journal mapping to Business Central.
  3. Map Sapera drafts to BC journals (either through a maintained map or a single journal strategy).
  4. Fetch financial entries per booking operation using paged requests.
  5. Ensure involved actors are synced in BC as Customers or Vendors.
  6. 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 by BookedAt 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 when OrganizationalUnitId 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 EntryKindBusiness Central AccountTypeIdentifier Used for Account Number
FinancialFinanskontoFinancialAccount number
DebtorDebitorCustomerIdentifier
CreditorCreditorSupplierIdentifier

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.

  1. Periodically call GetProductPage with ModifiedAfter filter to fetch products modified after a specific date (triggered by stock movements).
  2. Use OrganizationalUnitPropertiesRequest in the payload:
    • Provide OrganizationalUnitIds
    • Set PropertiesToLoad to include ProductOrganizationalUnitPropertiesToLoad.Availability
  3. Read returned OrganizationalUnitProperties.Availability field to get stock counts.
  4. Sync this data into Business Central accordingly.