1. Home
  2. Documentation
  3. Integration best practices

Integration best practices

Minimize your requests

To make your requests faster and more efficient, filter data using the available query parameters of endpoints.

For example, a GET /order request can be fine-tuned with specific orderDateFrom and orderDateTo parameters to avoid retrieving unnecessary order history. The isClosed parameter can be specified with a true or false value, and a customer ID can be used with customerId to narrow down further.

This reduces the number of objects requested, and reduces the data processed by the server’s SQL database query.

Minimize the response

To further improve efficiency, utilize the fields parameter to fetch only the necessary data, cutting down the response size.

For instance, if you only need the order number and some customer details from a GET /order request, your fields query could be formatted like this: fields=number,customer(displayName).

This method conserves bandwidth and processing power on both the server and client sides, resulting in quicker response times.

Error Handling

Proper error handling ensures smooth API integration. In addition to your system’s logging (e.g., request IDs, HTTP status codes), display crucial error information from the API response to users. Typically, just showing the error code and developer message suffices to help them identify issues.

Include your own brief message and design errors so users can forward them to your support if needed. If the Tripletex API error details don’t help you solve the problem, the developer of the integration can contact us via the contact form for developers.

Syncing data

To minimize unnecessary traffic with your integration and reduce load on our API, begin with an initial data sync. After that, use webhooks to track updates and changes to objects instead of polling with GET requests. The checksum method is another option, particularly for smaller datasets or those that change infrequently, yielding similar results to webhooks.

How can we help?