Async operations
Learn how to make asynchronous POST requests, which are useful for efficiency and to avoid timeouts for long-running requests.
Asynchronous POST requests are currently only supported in Merge’s Accounting category. This feature is currently in beta. Reach out to your account representative or contact us for more information.
Singular asynchronous requests
To make a singular asynchronous request, append /async at the end of the respective synchronous POST endpoint. For asynchronous requests, the server returns a task_id, a unique identifier used to track the status of the async operation.
Endpoint
POST /<common_model>/async
Sample response
To check the progress and get the final result, send a request to the task polling endpoint:
GET https://api.merge.dev/api/accounting/async-tasks/{task_id}.
Task statuses
Keep polling until the task reports COMPLETED or FAILURE, the only two terminal statuses. A task reports QUEUED for as long as it takes Merge to schedule the write, which can be several seconds after you receive the task_id, so treat QUEUED as normal rather than as a sign that the task_id is wrong.
Bulk asynchronous requests
For high-volume write operations, certain Common Models support the Bulk POST feature, which allows you to create or update multiple objects in a single API call rather than making separate requests for each one. Use this instead of singular async requests when you need to write many objects at once, since it minimizes API overhead and helps you stay within third-party rate limits.
Integration support
The bulk write endpoint currently supports the following integrations and Common Models. If you have specific Common Models or integrations you’d like to see coverage for, please let us know by reaching out to your CSM or [email protected]!
Endpoint
POST /<common_model>/bulk
Sample request body
The request body must adhere to the following requirements:
- Max payload size of 5 MB or 100 objects
- Each object must contain a unique
item_idthat maps to the item’s ID in the third-party system - Each object should be identical in structure to the payload used in the single-object POST endpoint for the corresponding Common Model
Sample response
To check the status or error messages returned from the 3rd party integration, utilize the batch polling endpoint:
GET /<common_model>/bulk/{batch_id}
Sample polling response
Batch statuses
Per-object statuses
Integration-specific behavior
For integration-specific behavior, data, and best practices, visit this help center article.
Webhooks
Instead of polling the async task status endpoints, you can subscribe to webhook events that fire automatically when async operations complete:
- AsyncPost.completed fires when a single async POST request reaches a terminal state (COMPLETED or FAILURE).
- AsyncBulkPost.completed fires when a bulk async POST batch reaches a terminal state (SUCCESS, PARTIAL_SUCCESS, or FAILED).
For full payload examples and instructions, see Merge Webhooks.