Distru icon

Distru

Interact with the Distru API

Overview

The node interacts with the Distru API to retrieve or manipulate purchase data among other resources. Specifically, for the "Get Purchase" operation, it fetches purchase records from Distru, optionally filtered by various date fields, status, and pagination parameters. This is useful in scenarios where you want to automate workflows involving purchase order tracking, inventory management, or financial reconciliation by programmatically accessing purchase information.

For example, you could use this node to:

  • Retrieve all purchases with a status of "Pending" to trigger follow-up actions.
  • Filter purchases created within a specific date range for reporting.
  • Paginate through large sets of purchase data to sync with another system.

Properties

Name Meaning
Due Datetime Filter purchases by their due datetime (e.g., before or after a certain date/time).
Inserted Datetime Filter purchases by their creation datetime (e.g., purchases created on or after a specific date/time).
Order Datetime Filter purchases by the order datetime (supports range filtering).
Status Filter purchases by their status. Possible values: Completed, Delivering, Partially Received, Pending, Processing.
Updated Datetime Filter purchases by the datetime they were most recently modified.
Page Number The page number of results to return for pagination.
Page Size The number of results per page to return for pagination.

These properties are provided under the "Additional Fields" collection when the operation is set to "Get Purchase".

Output

The output is an array of JSON objects representing purchase records retrieved from the Distru API. Each item corresponds to one purchase entry with its full details as returned by the API.

The structure of each purchase JSON object includes fields such as purchase ID, dates, status, items, charges, and related metadata. The exact fields depend on the Distru API response schema for purchases.

This node does not output binary data.

Dependencies

  • Requires an API token credential for authenticating requests to the Distru API.
  • The base URL used depends on whether staging mode is enabled in credentials (staging or production endpoint).
  • No additional external dependencies beyond standard HTTP request capabilities provided by n8n.

Troubleshooting

  • Missing API Token: If the API token is not set in credentials, the node will throw an error "Distru API token is not set!" Ensure the API key is configured correctly.
  • Invalid Filters: Providing invalid date formats or unsupported status values may cause the API to reject the request or return no data.
  • Pagination Issues: If the page number or size is set incorrectly, you might get empty results or miss some data. Adjust these parameters carefully.
  • API Errors: Network issues or API downtime can cause request failures. Check connectivity and API status if errors occur.
  • Unsupported Operation: Using an operation name not supported by the node will result in an error indicating the operation is not supported.

Links and References

Discussion