Overview
Solink's Data Integration Webhook provides a powerful mechanism for posting multiple events simultaneously through batching. This feature allows users to efficiently send up to 100 events in a single request, optimizing network usage and reducing the number of HTTP requests made to the Solink API. Batching is particularly useful for applications that generate a high volume of events and need to transmit them efficiently while adhering to the set rate limits.
Benefits of Batching
Efficiency: Reduces the number of HTTP connections needed, conserving bandwidth and server resources.
Speed: Enhances the speed of data transmission by grouping multiple events into a single request.
Simplified Error Handling: Manages errors for a batch of requests collectively, rather than individually.
Rate Limit Compliance: Helps in staying within the prescribed rate limits by minimizing the number of requests.
Implementation Details
The webhook accepts a JSON array containing up to 100 event objects. Each event in the batch is processed independently, but all are contained within a single HTTP request. This means that if the payload size for the entire batch does not exceed the maximum allowed payload size of 10 MB, it can be processed in one go.
Rate Limits and Batching
While batching allows the submission of multiple events per request, it is important to note that each batched request counts towards the daily and per-second rate limits set by the API. Users should plan their batching strategy to maximize efficiency without exceeding these limits.
Example
Below is an example of how to structure a batch request body format for the Data Integration Webhook. This request body example demonstrates how to send multiple events in a single API call:
[
{
"dataType": "other",
"schemaVersion": "1",
"startTime": 1557943653649,
"endTime": 1557943678649,
"locationId": "123",
"dataSourceId": "1",
"eventUniqueId": "93688-START",
"eventType": "Start Batch",
"eventDetails": "Additional Details",
"employeeId": "27",
"employeeName": "MICHELLE",
"status": “START”,
"items": [
{
"type": "",
"quantity": 1.0,
"description": "",
"time": 1555898203000
}
]
},
{
"dataType": "restaurant",
"schemaVersion": "1",
"startTime": 1557943653649,
"endTime": 1557943678649,
"locationId": "123",
"dataSourceId": "1",
"transactionId": "93688",
"employeeId": "27",
"employeeName": "MICHELLE",
"status": "SALE",
"customerId": "",
"tableNumber": "12",
"guestCount": 1,
"items": [
{
"type": "sale",
"quantity": 1.0,
"description": "Burger",
"unitPrice": 22.00,
"time": 1555898203000
},
{
"type": "modifier",
"quantity": 1.0,
"description": "No onions",
"unitPrice": 0,
"time": 1555898203000
},
{
"type": "tax",
"quantity": 1.0,
"description": "PST",
"unitPrice": 2.00,
"time": 1557943678649
},
{
"type": "payment",
"quantity": 1.0,
"description": "Credit",
"unitPrice": 20.00,
"cardNumberLast4": "1234",
"time": 1557943678649
}
]
},
.
.
.
{
//100th event
}
]