decogro

n8n custom node for Decogro integrations

Package Information

Released: 11 mo ago
Downloads: 6 weekly / 20 monthly
Latest Version: 1.0.5
Author: Decogro Dev Team

Documentation

n8n Decogro Node

A comprehensive n8n custom node for integrating with Decogro API services. This node provides complete access to Decogro's order management, contact management, company management, file operations, and administrative functions.

Features

  • 🎯 Resource-Based Organization - Operations grouped into logical categories
  • 📦 Order Management - Create, update, retrieve orders and manage order items
  • 👥 Contact & Company Management - Full CRUD operations for contacts and companies
  • 📁 File Operations - Upload and retrieve files
  • ⚙️ Admin Operations - Access approvals, fees, delivery methods, and more
  • 🔐 Secure Authentication - Bearer token authentication
  • 📊 Pagination Support - Built-in limit/offset pagination for list operations

Installation

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Build the project:
    npm run build
    
  4. Copy the dist folder to your n8n custom nodes directory

Usage

Setup Credentials

  1. In n8n, go to Settings > Credentials
  2. Add new credentials and select "Decogro API"
  3. Enter your:
    • API Key: Your Decogro API key (Bearer token format)
    • Base URL: Your Decogro API base URL (e.g., http://localhost:3000/)

Using the Node

  1. Add the "Decogro" node to your workflow
  2. Select a Resource from the dropdown:
    • Order - Order-related operations
    • Contact - Contact management
    • Company - Company management
    • Files - File operations
    • Admin - Administrative functions
  3. Choose an Operation within that resource
  4. Configure any required parameters (IDs, JSON bodies, etc.)

Available Operations

📦 Order Operations

  • Get Orders - Retrieve orders with pagination
  • Create Order - Create new orders with detailed specifications
  • Update Order - Update existing orders
  • Get Order Items - Retrieve items for a specific order
  • Add Manual Payment - Add manual payments to orders
  • Add Approval - Add approval requests to orders
  • Create Order Imprint - Create imprints for order groups
  • Recalculate Group - Recalculate pricing for order groups
  • Request Payment - Send payment requests for orders

👥 Contact Operations

  • Get Contacts - Retrieve contacts with search and pagination
  • Create Contact - Create new contacts
  • Update Contact - Update existing contacts
  • Get Contact Addresses - Retrieve addresses for contacts
  • Add Contact Address - Add addresses to contacts

🏢 Company Operations

  • Get Companies - Retrieve companies with search and pagination
  • Create Company - Create new companies
  • Update Company - Update existing companies

📁 Files Operations

  • Get Files - Retrieve file listings with pagination
  • Upload File - Upload files using binary data

⚙️ Admin Operations

  • Get Approvals - Retrieve approval configurations
  • Get Fees - Retrieve fee structures
  • Get Delivery Methods - Retrieve delivery options
  • Get Payment Terms - Retrieve payment term configurations
  • Get Categories - Retrieve product categories
  • Get Pricing Matrices - Retrieve pricing matrix configurations
  • Get Users - Retrieve user accounts
  • Get Email Templates - Retrieve email template configurations

Development

  • npm run build - Build the project
  • npm run dev - Build in watch mode
  • npm run copy-assets - Copy icon assets to dist folder

Configuration Examples

Creating an Order

{
  "name": "Summer T-Shirt Order",
  "customer": {
    "contact_id": 1,
    "billing_address": {
      "company": "ABC Company",
      "billing_name": "John Doe",
      "billing_address1": "123 Main St",
      "billing_city": "New York",
      "billing_state": "NY",
      "billing_zip": "10001"
    }
  },
  "info": {
    "in_hands_date": "2025-09-19",
    "delivery_method": 1,
    "owner": 1
  },
  "line_groups": [{
    "items": [{
      "category_id": 1,
      "description": "Cotton T-Shirt",
      "price": 10,
      "qty": 50
    }]
  }]
}

Creating a Contact

{
  "First Name": "John",
  "Last Name": "Doe",
  "Email": "john.doe@example.com",
  "Phone": "+1-555-0123",
  "Company": 1,
  "Job Title": "Manager"
}

Output Format

All operations return a structured response:

{
  "operation": "getOrders",
  "data": {
    // API response data
  },
  "metadata": {
    "method": "GET",
    "endpoint": "order",
    "timestamp": "2025-01-27T10:30:00.000Z",
    "limit": 10,
    "offset": 0,
    "page": 1
  }
}

Error Handling

The node supports error handling through n8n's continue-on-fail mechanism. Failed requests return:

{
  "error": "Error message",
  "operation": "operationName",
  "timestamp": "2025-01-27T10:30:00.000Z"
}

API Compatibility

This node is designed to work with Decogro API endpoints and supports:

  • Bearer token authentication
  • JSON request/response format
  • File upload via multipart/form-data
  • Standard HTTP methods (GET, POST, PATCH)

License

MIT

Discussion