This guide covers the design of a data contract for transferring approved documents from an electronic document management system to an accounting system. The transfer of document D01, version 1, is used as an illustrative example. When preparing for a project with IQusion IT, it is important to pre-define requirements for data structure, error handling, and retries. The company's stated public scope of services covers system integration, exchange formats, route configuration, and testing. This is a declaration of areas of work, not a confirmation of ready-made connectors. The purpose of this material is to form an understanding of how to separate the transport layer from business logic, ensure the idempotency of operations, and prepare acceptance criteria for implementation.

Integration Basics and Data Contract Definition

Designing the interaction between an electronic document management system and an accounting system begins with creating a data contract. This document defines what information is transmitted and the rules by which the transaction is processed. IQusion's public service description notes that document management implementation includes route surveying, model configuration, role distribution, and integration. This is a basic service where the customer prepares their own exchange requirements.

For illustration, a synthetic example is considered: approved document D01, version 1, crosses the boundary between systems. The sender forms a standardized data package. Public information about system integration services defines working with data contracts as part of the project. The system's behavior during the transfer of document D01 is a proposed requirement that must be implemented.

Successful integration requires the alignment of data dictionaries. The document management system operates with cards and routes, while the accounting system works with postings and counterparties. The data contract serves as a bridge, transforming document attributes into financial instructions.

Sources: [1], [2]

Structure of the Proposed Data Contract

The proposed data contract for transferring document D01, version 1, must contain the necessary set of fields for identifying and processing the operation. The first field is document_id, which points to the card number in the document management system. The second field is version, which records the specific document revision that has been approved. The third field is operation_id. This is a unique transaction identifier that is generated on the sender's side and accompanies the request at all stages.

In addition to identifiers, the contract includes business attributes. The status field conveys the current state of the document. The currency and amount fields contain financial information: the currency code and the transaction amount. The counterparty_id field defines the counterparty identifier. All these data form a single package that is sent to the accounting system.

Defining such a structure allows for the standardization of data exchange. The proposed set of attributes is a basic artifact that can be expanded. The presence of operation_id and version provides a foundation for building a reliable interaction architecture that is resistant to network failures.

Separating Transport Delivery and Business Validation

In this proposed contract, the transport acknowledgement means only that the D01 package has been accepted for processing. It does not confirm structural validity, readiness of every component, or an accounting posting. Format checks, business checks, and the posting result have separate statuses. The team must agree what each status means and how the final outcome is obtained so that the sender does not treat the initial acknowledgement as completion of the business operation.

After transport confirmation, the business validation stage begins. The accounting system checks whether the counterparty_id exists in the directories, whether the amount meets limits, and whether the financial period is closed. If an error occurs, the system generates a rejection message at the business logic level. The public description of integration services mentions error handling as part of the project work, which emphasizes the need for pre-designing such scenarios.

A processing timeout creates uncertainty about the outcome: the operation may have completed even though its response did not arrive. This does not prove data loss. For this example, the team may agree asynchronous processing with separate retrieval of the final status. A synchronous approach is also possible if the contract defines how to check an unknown outcome and retry without duplication. The choice depends on check duration, state persistence, and the capabilities of the target systems.

Sources: [1]

Handling Lost Responses and Operation Idempotency

The contract must account for a lost response. If D01 has been sent but its outcome is unknown, first check the operation status or perform the agreed safe retry. Retry the unchanged payload with the same operation_id. A new identifier may cause duplicate posting if the receiver treats it as a separate business operation. Also define how long operation records are retained and what to do after that period: an identifier alone does not remove duplication risk without the corresponding receiver logic.

The ability of an accounting system to safely process repeated requests with the same operation_id is called idempotency. If the system receives a request with an identifier that has already been successfully processed, it does not create a new posting but returns the previous successful response. No public information states that a specific product automatically implements idempotency; this is a proposed requirement that the customer must include in the acceptance criteria.

A separate situation is considered when the content of the document changes after the initial sending. If document D01 was rejected, edited, and re-approved, it receives a new version. Changing the document version means initializing a new business operation. It requires the generation of a new operation_id and going through the full approval cycle. Blindly re-sending changed data under an old operation identifier is a violation of integration logic.

Exception handling scenarios during data contract transfer
Exception handling scenarios during data contract transfer
Error Scenario System Action Resolution Owner Stored Evidence
Missing counterparty mappingRejection with an explicit status defining whether revalidation is allowed after directory repairAccounting system administratorBusiness error log with transmitted counterparty_id
Receiver system unavailabilityRetry sending after a set time intervalElectronic document management systemTransport timeout log
Duplicate operationReturn previous status without creating a duplicateAccounting systemRecord of operation_id in the database
Data conflict for existing operation_idRequest blocking, critical warning generationInformation security officerOriginal and new data packages for comparison

Sources: [1], [2]

Acceptance Criteria and Specific Next Steps

To verify the correctness of the integration, it is necessary to form clear expectations for testing. These expectations are based on synthetic data and do not contain actual test results for specific products. The positive scenario involves sending document D01 with a unique operation_id. It is expected that the accounting system will accept the package, successfully perform business validation, and create the corresponding financial posting, returning a success status.

The duplication check scenario requires sending an identical data package with the same operation_id after the successful completion of the first request. It is expected that the accounting system will recognize the duplicate, not create a second posting, but return a success message, simulating the recovery of a lost response. This confirms compliance with the idempotency requirement.

The data conflict scenario involves sending a request with an already used operation_id, but with a different amount or a different counterparty_id. It is expected that the system will reject such a request with a data conflict error. The next specific step for the project team is to develop detailed test cases based on these expectations, configure the test environment, and conduct isolated runs for each of the described scenarios before moving to the pilot operation stage.

Action checklist

  • Define the list of data contract fields: document_id, version, operation_id, status, currency, amount, and counterparty_id.
  • Establish the rule for generating a unique operation_id on the sender's side for each new business operation.
  • Design a mechanism to separate transport confirmation from business validation results.
  • Develop an algorithm for retrying data transmission in case of transport failures without changing the operation identifier.
  • Prepare synthetic data sets to verify positive scenarios, duplication, and payload conflicts.

Questions and answers

Why can't document_id be used as the sole operation identifier?

One document may have multiple versions and business operations. operation_id identifies one such operation and is retained across its retransmissions; each transport attempt may have its own technical identifier. Preserve its relationship to document_id and version in the exchange history.

What should be done if the accounting system rejected a document due to an unknown counterparty?

First determine the rejection status. If the contract permits business revalidation after the directory is corrected, explicitly trigger that check for the unchanged payload with the same operation_id. If rejection is final and the response is cached, a blind retry will return the old rejection: an agreed state transition or a new corrective operation linked to the original is needed. Agree this rule before testing.

How can I ensure that the system supports idempotency?

Idempotency is not guaranteed by default. Its presence is verified by sending duplicate requests with the same operation_id during acceptance testing. The system must return a success status but not create duplicate records.

Sources

  1. Системна інтеграція | Розумна компанія IQusion
  2. Впровадження документообігу | Розумна компанія IQusion

Explore the related service ↗