In Beta
The batch push webhooks are part of our beta v2 APIs which are not officially supported for the general public.
The Batch Push Status event is fired when a batch push API request has finished processing through Accounting Data as a Serviceā¢ and the accounting service provider.
Event Object
The webhook payload is sent in standard JSON format and contains an event object with the following information represented by key-value pairs (KVPs):
Element | Type | Description |
---|---|---|
event | string | Unique event name for the webhook. Set to batchPush . |
connectionId | string | The connection id associated with the webhook. Automatically assigned by Accounting Data as a Serviceā¢. See connections for more details. |
businessName | string | The business name associated with the webhook. See businesses for more details. |
serviceName | string | The name of the connected integration. See possible enum values. |
batchId | string | Unique batch ID for the webhook. Automatically assigned by Accounting Data as a Serviceā¢. |
batch | array | Batch push objects in your batch push request. The order of the batch push objects in this batch array matches the order of your original request. |
serviceAccountRef | object | Object containing the account id and subsidiary or sub account id for the connection |
Each object in the batch
array may include the following elements:
Element | Type | Description |
---|---|---|
pushCommunicationId | string | Unique push request ID. Automatically assigned by Accounting Data as a Serviceā¢. |
sourceObjectIds | array | An array of strings representing the created object ids in the service providers. |
dataType | string | The data type associated with the webhook. See /data/dataTypes endpoint for all possible enum values. |
requestedOn | string | The date and time at which the batch push was requested. See date format for more details. |
completedOn | string | The date and time at which the batch push was completed. See date format for more details. |
status | string | The status of the batch push request. Possible values: success , failed . |
responseCode | integer | Standard HTTP response code from the service provider. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Accounting Data as a Serviceā¢ related issues. |
validation | object | An object containing an array of errors . Returned if a specific batch push object failed. |
Each object in the errors
array may include the following elements:
Element | Type | Description |
---|---|---|
field | string | The name of the element or property in the original request associated with the validation or error. |
message | string | A user-friendly validation or error message sent by the service provider. |
serviceAccountRef
object may include the following elements:
Element | Type | Description |
---|---|---|
id | string | Account id for the connection |
entityRef.id | string | Sub account or Subsidiary account id for the connection |
Example Data Push Event Object
{
"data": {
"event": "batchPush",
"connectionId": "CON-0a4e97aa-7a77-bbbb-00aa-b1b1001aa00",
"businessName": "BIZ-d6b1c7d3-fe41-4447-ae72-3814b78b5142",
"serviceName": "xero",
"batchId": "63c6d1d02175edb3822e8d47",
"batch": [
{
"pushCommunicationId": "63c6d1d02175edb3822e8d4d",
"sourceObjectIds": ["235"],
"dataType": "journalEntries",
"requestedOn": "2023-01-17T16:50:24.063Z",
"completedOn": "2023-01-17T16:50:30.579Z",
"status": "success",
"responseCode": 200
},
{
"pushCommunicationId": "63c6d1d02175edb3822e8d4e",
"sourceObjectIds": ["289"],
"dataType": "journalEntries",
"requestedOn": "2023-01-17T16:50:24.063Z",
"completedOn": "2023-01-17T16:50:30.679Z",
"status": "success",
"responseCode": 200
},
{
"pushCommunicationId": "63c6d1d02175edb3822e8d4f",
"sourceObjectIds": [],
"validation": {
"errors": [
{
"message": "Business Validation Error: When you use Accounts Payable, you must choose a supplier in the Name field."
}
]
},
"dataType": "journalEntries",
"requestedOn": "2023-01-17T16:50:24.064Z",
"completedOn": "2023-01-17T16:50:30.579Z",
"status": "failed",
"responseCode": 400
}
]
},
"serviceAccountRef": {
"id": "DEV",
"entityRef": {
"id": "100"
}
},
"requestId": "7c8648ce-8244-4948-9a0f-7d01e665d1aa"
}