Once a data aggregation process has been completed, a notification request will be made to the webhook provided in the request payload. This is an outgoing request made by Doshii.
Note: In some cases, direct access may be granted to the actual file storage, in which case, once the webhook notification has been received, the aggregated data files can be directly obtained from their storage, bypassing the need for making further download requests (GET) for each file.
The webhook request will be issued using the POST HTTP method. In addition to the headers mentioned below, the process will also use any headers specified in the initial bulk data request. Either a 200 or 201 is expected to be returned to consider the webhook call successful.
Headers
Field | Type | Description |
---|---|---|
Content-Type | String |
The content type of application/json will be passed through on all webhook requests. |
Response
Field | Type | Description |
---|---|---|
requestId | String |
Unique ID identifying this request. |
requestCompletedAt | Number/Epoch Unix Time |
The date when the request was completed and made available for download. The value will be in epoch unix time (in seconds). |
files | Object[] |
The data files produced by the aggregation process. There will be at least one file in the array. |
uri | String |
The URI from where the file is to be downloaded (GET). This endpoint expects valid authentication. Invalid authentication requests will be rejected with a 401 HTTP status code. |
size | Number |
The total size of the file, in kilobytes, after being compressed. |
expires | Number/Epoch Unix Time |
The date at which the file will expire. Expired files will be expunged from the service and will no longer be available for download. The value will be in epoch unix time (in seconds). |
tally | Object |
Provides metrics on the data that was extracted. |
locations | Number |
The total number of locations processed for the requested data aggregation job. |
orders | Number |
The total number of orders, across all locations, processed for the requested data aggregation job. |
transactions | Number |
The total number of transactions, across all locations and orders, processed for the requested data aggregation job. Some orders may have more than one transaction. |
amount | Number |
The total amount (in cents), across all locations, orders and transaction, processed for the requested data aggregation job. Some transaction amounts may have negative values. |
Examples
Request
HTTPS/1.1
POST {webhook.uri}
Content-Type: application/json
Content-Length: 156
{
"requestId": "e1182944-3b97-4ac3-9839-d1a7b56c2c79",
"requestCreatedAt": 1539665129,
"status": "complete",
"requestCompletedAt": 1539665329,
"files": [
{
"uri": "/we23XDs1/e1182944-3b97-4ac3-9839-d1a7b56c2c79/fileName.json.gzip",
"size": 10002,
"expires": 1542933823
}
],
"tally": {
"locations": 1,
"orders": 100,
"transactions": 105,
"amount": 1200
}
}
Comments
0 comments
Please sign in to leave a comment.