Handling concurrency

Invoice-related operations should be run with very strict concurrency rules to ensure they don't collide with each other. To help you control concurrency, CorrigoPro Direct provides an optimistic concurrency control mechanism based on a concurrency identifier primitive.

Each CorrigoPro Direct API request, related to invoices, expects an optional ConcurrencyId property. In turn, each successful CorrigoPro Direct API response contains actual invoice ConcurrencyId value.
When you pass ConcurrencyId value within a request, system checks whether provided value is equal to actual invoice concurrency identifier. If they mismatch, it means that caller is not aware of the latest invoice state, so incoming request is discarded.
Valid (actual) concurrency identifiers are retrieved through GET /api/invoice method of the CorrigoPro Direct API.

If you handle concurrency at your end or you don't expect any concurrency issues, simply ignore concurrencyId attribute in request/response models. In this case requests coming to the CorrigoPro Direct API are considered as high-priority ones and will override any concurrent requests.