Actions22
Overview
This node integrates with the Distru API to manage various inventory and business operations related to products, batches, orders, invoices, purchases, and more. Specifically, the Post Batch operation allows users to create a new batch record associated with a product in the Distru system.
Typical use cases include:
- Creating a new batch for a product when receiving or producing inventory.
- Tracking batch-specific details such as batch number, expiration date, and description.
- Automating batch creation workflows within an inventory management or supply chain process.
For example, after receiving a shipment of a product, you can use this node to post a batch with its unique batch number and expiration date to keep track of inventory lots.
Properties
| Name | Meaning |
|---|---|
| Product ID | The unique identifier of the product to which the batch belongs. (Required) |
| Owner ID | Optional identifier for the owner of the batch. |
| Batch Number | Optional string representing the batch number or code. |
| Expiration Date | Optional expiration date of the batch, typically in ISO 8601 string format. |
| Description | Optional textual description or notes about the batch. |
Output
The output is a JSON object representing the newly created batch as returned by the Distru API. It includes all batch details such as:
id: Unique batch identifier assigned by Distru.product_id: The product's unique ID linked to this batch.batch_number: The batch number if provided.expiration_date: Expiration date if provided.description: Any descriptive text included.- Other metadata fields as returned by the API.
No binary data is produced by this operation.
Dependencies
- Requires an API token credential for authenticating requests to the Distru API.
- The base URL for API calls depends on whether staging mode is enabled (
https://staging.distru.com/public/v1) or production (https://app.distru.com/public/v1). - Proper network access to Distru endpoints is necessary.
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 Product ID: The product ID must be a valid UUID or convertible string; otherwise, the API may reject the request.
- API Errors: Any errors from the Distru API (e.g., invalid parameters, authorization failures) will be surfaced as node errors. Check the error message for details.
- Batch Creation Failures: Ensure that required fields like
product_idare provided. Optional fields should be formatted correctly (e.g., expiration date in ISO format).
Links and References
- Distru API Documentation (for detailed API usage and field definitions)
- n8n Documentation on Creating Custom Nodes
- General info on UUID formats
This summary focuses exclusively on the "Post Batch" operation of the Distru node based on the provided source code and input property definitions.