Understanding Batch Number Behaviour When Importing Timesheets Using Concurrent API Calls
Summary
When integrating with the Import Timesheets API (/entity/ADVPAU/20.200.001/Timesheet), some integrations use concurrent (multi-threaded) API calls to improve performance. Although the integration correctly uses multiple sessions or tokens for each thread, the system produces duplicate Batch Numbers and inconsistent data during concurrent processing.
Why This Occurs
The Timesheet Import process is not designed to handle simultaneous inserts or updates efficiently when multiple requests are submitted concurrently
When multiple API calls are processed concurrently, MYOB Acumatica may allocate the same Batch Number to more than one timesheet.
This is not related to authentication or session reuse
Recommended Integration Approach
1. Use Sequential API Calls for Timesheet Import
Timesheet imports should be processed sequentially instead of concurrently.
Sequential processing ensures that batch creation occurs safely and prevents Batch Number duplication.
2. Implement Retry Logic
Include retry logic with exponential backoff in your integrations to manage:
Timeouts
Throttling
Transient network conditions
This ensures reliability during sequential execution without causing data duplication
3. Avoid Parallel Timesheet Imports
Concurrent requests, regardless of separate sessions or tokens, can cause batch number collisions.
Avoid multi-threaded or parallel calls for this endpoint.
4. Multiple Sessions or Tokens Are Still Valid
The use of multiple sessions or OAuth tokens is correct overall. However, this approach should not be applied to Timesheet Imports to align with the system's batch handling design