Distru icon

Distru

Interact with the Distru API

Overview

This node integrates with the Distru API to retrieve and manage company-related data and other resources such as products, orders, contacts, batches, and more. Specifically, the "Get Company" operation fetches company information from Distru, supporting pagination and filtering by inserted or updated datetime.

Use cases include:

  • Retrieving a list of companies or details of a specific company for inventory, order management, or reporting.
  • Automating workflows that require up-to-date company data from Distru.
  • Integrating company data into other systems or dashboards.

Example: Fetching all companies created or updated after a certain date, paginated 100 results per page.

Properties

Name Meaning
Additional Fields Collection of optional filters and pagination parameters:
- Inserted Datetime Filter companies by their creation datetime (ISO 8601 format).
- Updated Datetime Filter companies by their last updated datetime (ISO 8601 format).
- Page Number Page number of results to return (pagination). Defaults to 1.
- Page Size Number of results per page (pagination). Defaults to 100.

Output

The output is an array of JSON objects representing company data retrieved from the Distru API.

  • If a specific company ID is provided, the output contains one object with detailed company information.
  • Otherwise, it returns multiple company objects according to pagination and filters.
  • The json field contains the raw company data as returned by the API.
  • No binary data is output by this operation.

Example output snippet:

[
  {
    "json": {
      "id": "company-uuid",
      "name": "Company Name",
      "address": "...",
      "phone": "...",
      "email": "...",
      // other company fields
    }
  },
  ...
]

Dependencies

  • Requires an API token credential for authenticating requests to the Distru API.
  • The base URL switches between production and staging environments based on configuration.
  • Uses HTTP GET requests to the Distru public API endpoints.
  • Pagination and filtering are supported via query parameters.

Troubleshooting

  • Missing API Token: The node will throw an error if the API token credential is not set. Ensure you have configured the required API authentication token in n8n credentials.
  • Invalid Filters: Providing incorrectly formatted datetime strings may cause API errors. Use ISO 8601 format for datetime fields.
  • Pagination Issues: Requesting pages beyond available data will return empty results; adjust page number accordingly.
  • Network Errors: Check network connectivity and API availability if requests fail.
  • Operation Not Supported: Selecting an unsupported operation will raise an error.

Links and References

Discussion