This is a native n8n node package for a cannabis erp software called Distru
npm install n8n-nodes-distruThis is an n8n community node for integrating with Distru, a cannabis ERP software. It provides a comprehensive set of operations to interact with the Distru API.
Follow these steps to install this node in your n8n instance:
``bash`
npm install n8n-nodes-distru
For n8n versions < 0.200, use:
`bash`
npm install n8n-nodes-distru@^1.0.0
You need to configure your Distru API credentials before using this node:
1. Open your n8n instance
2. Go to Settings > Credentials
3. Click on "Add Credential"
4. Search for "Distru API"
5. Enter your API Token
6. (Optional) Enable "Use Staging" if you want to use the staging environment
Most operations support additional fields for filtering and customization:
- Page Number
- Page Size
- Inserted Datetime
- Updated Datetime
- Various IDs for specific resources
json
{
"operation": "getProduct",
"additionalFields": {
"id": "product-id-here",
"page_size": 1
}
}
`$3
`json
{
"operation": "upsertPurchase",
"company_id": "company-id-here",
"billing_location_id": "location-id-here",
"items": [
{
"product_id": "product-id-here",
"quantity": 10,
"price": 100,
"location_id": "location-id-here"
}
]
}
`Support
For issues and feature requests, please create an issue on GitHub.
License
🎯 Features
The package currently includes a single consolidated node:
$3
- Company: Get (with filtering and pagination)
- Product: Create, Update, Get (with filtering and pagination)
- Sales Order: Upsert, Get (with filtering and pagination)🚀 Getting Started
$3
Before you begin, ensure you have:
- Node.js version 18.12 or higher
- pnpm package manager (version 9.1 or higher)
- n8n installed globally (
pnpm install -g n8n)
- A Distru account with API access$3
1. In your n8n instance, go to Settings > Credentials
2. Click on New Credential
3. Search for "Distru API"
4. Enter your Distru API token
5. (Optional) Toggle "Use Staging Environment" if you want to use the staging API
🔧 Development Setup
If you want to contribute or modify this node:
1. Clone the repository:
`bash
git clone https://github.com/Sebbytea/distru-n8n.git
cd distru-n8n
`
2. Install dependencies:
`bash
pnpm install
`
3. Build the package:
`bash
pnpm build
`
4. Link to your local n8n installation:
`bash
pnpm link
`📚 Usage Examples
$3
All GET operations (Company, Product, Sales Order) support filtering and pagination via the Additional Fields collection:
- ID: If set, fetches a single record by ID. If not found, falls back to filtering by ID in the collection endpoint.
- Page Number: The page number to fetch (default: 1).
- Page Size: The number of records per page (defaults: 5000 for Company/Product, 500 for Sales Order; these are also the max values).
- Other Filters: Use any other available fields to filter results (e.g., Inserted Datetime, Updated Datetime, Status, etc.).
#### Example: Get All Products, 5000 Per Page
1. Add the Distru node to your workflow
2. Select the "Product: Get" operation
3. In Additional Fields, set:
- Page Number:
1
- Page Size: 5000
- (Optional) Add filters like Inserted Datetime, Updated Datetime, etc.
4. Run the node to retrieve up to 5000 products on the first page#### Example: Get a Company by ID
1. Add the Distru node
2. Select the "Company: Get" operation
3. In Additional Fields, set:
- ID:
4. Run the node to retrieve the company by ID#### Example: Get Orders with Status Filter and Pagination
1. Add the Distru node
2. Select the "Sales Order: Get" operation
3. In Additional Fields, set:
- Status:
PENDING
- Page Number: 1
- Page Size: 500
4. Run the node to retrieve the first 500 pending orders🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
1. Fork the repository
2. Create your feature branch (
git checkout -b feature/AmazingFeature)
3. Commit your changes (git commit -m 'Add some AmazingFeature')
4. Push to the branch (git push origin feature/AmazingFeature`)This project is licensed under the MIT License.
- Distru API Documentation
- n8n Community Nodes Documentation
- n8n Community Forum
For support with this node, please:
1. Check the GitHub Issues for existing problems and solutions
2. Create a new issue if your problem isn't already reported
3. Contact Distru support for API-specific questions
---
Made with ❤️ by Sebastian Tidwell