JSPM

n8n-nodes-tiny-erp-v3

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q42990F
  • License MIT

n8n node for Tiny ERP API v3 integration with OAuth2 - includes estoque operations

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (n8n-nodes-tiny-erp-v3) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    n8n-nodes-tiny-erp

    This is an n8n community node that provides integration with the Tiny ERP API v3. It allows you to interact with Tiny ERP's comprehensive business management system directly from your n8n workflows.

    Tiny ERP Logo

    Features

    This node supports the following Tiny ERP resources and operations:

    ๐Ÿ›๏ธ Products

    • Get all products
    • Get product by ID
    • Search products by SKU or other criteria
    • Create new products
    • Update existing products
    • Delete products
    • Get product stock information

    ๐Ÿ‘ฅ Customers

    • Get all customers
    • Get customer by ID
    • Create new customers
    • Update existing customers
    • Delete customers

    ๐Ÿ“ฆ Orders

    • Get all orders
    • Get order by ID
    • Create new orders
    • Update existing orders
    • Update order status

    ๐Ÿงพ Invoices

    • Get all invoices
    • Get invoice by ID
    • Create new invoices
    • Send invoices

    ๐Ÿ“Š Stock Management

    • Get stock movements
    • Update product stock
    • Get stock updates

    ๐Ÿ“ž Contacts

    • Get all contacts
    • Get contact by ID
    • Create new contacts
    • Update existing contacts

    ๐Ÿข Account

    • Get account information

    Installation

    1. Go to Settings > Community Nodes in your n8n instance
    2. Click Install a community node
    3. Enter n8n-nodes-tiny-erp
    4. Click Install

    Manual Installation

    1. Navigate to your n8n installation directory
    2. Run: npm install n8n-nodes-tiny-erp
    3. Restart your n8n instance

    Local Development

    1. Clone this repository
    2. Install dependencies: npm install
    3. Build the project: npm run build
    4. Link to your n8n installation: npm link
    5. In your n8n directory: npm link n8n-nodes-tiny-erp

    Prerequisites

    Before using this node, you need to:

    1. Create a Tiny ERP Account: Sign up at Tiny ERP
    2. Set up OAuth2 Application:
      • Go to your Tiny ERP developer console
      • Create a new OAuth2 application
      • Note down your Client ID and Client Secret
      • Set the redirect URI to your n8n OAuth callback URL

    Configuration

    Setting up OAuth2 Credentials

    1. In n8n, go to Credentials

    2. Click Create New Credential

    3. Search for "Tiny OAuth2 API"

    4. Fill in the required fields:

      • Client ID: Your Tiny ERP OAuth2 Client ID
      • Client Secret: Your Tiny ERP OAuth2 Client Secret
      • Authorization URL: https://accounts.tiny.com.br/realms/tiny/protocol/openid-connect/auth
      • Access Token URL: https://accounts.tiny.com.br/realms/tiny/protocol/openid-connect/token
    5. Click Connect my account to authorize the connection

    Usage Examples

    Example 1: Get All Products

    {
      "resource": "product",
      "operation": "getAll",
      "options": {
        "limit": 50,
        "page": 1
      }
    }

    Example 2: Search Product by SKU

    {
      "resource": "product",
      "operation": "search",
      "search": "LAPTOP-001",
      "options": {
        "limit": 10,
        "page": 1
      }
    }

    Example 3: Create a New Customer

    {
      "resource": "customer",
      "operation": "create",
      "additionalFields": {
        "nome": "Joรฃo Silva",
        "email": "joao@example.com",
        "telefone": "+55 11 99999-9999",
        "cpf_cnpj": "123.456.789-00",
        "endereco": "Rua das Flores, 123",
        "cidade": "Sรฃo Paulo",
        "uf": "SP",
        "cep": "01234-567"
      }
    }

    Example 4: Update Product Stock

    {
      "resource": "stock",
      "operation": "updateStock",
      "productId": "12345",
      "stockQuantity": 100
    }

    Example 5: Update Order Status

    {
      "resource": "order",
      "operation": "updateStatus",
      "id": "67890",
      "status": "enviado"
    }

    API Endpoints

    The node connects to the Tiny ERP API v3 at:

    • Base URL: https://erp.tiny.com.br/public-api/v3
    • Authentication: OAuth2 with Bearer token
    • Documentation: Tiny ERP API v3 Swagger

    Error Handling

    The node includes comprehensive error handling:

    • Authentication Errors: Automatically handled through OAuth2 refresh tokens
    • Rate Limiting: Respects API rate limits with appropriate error messages
    • Validation Errors: Clear error messages for invalid input data
    • Network Errors: Retry logic for temporary network issues

    Supported Order Statuses

    When updating order status, you can use these values:

    • pendente - Pending
    • aprovado - Approved
    • producao - In Production
    • enviado - Shipped
    • entregue - Delivered
    • cancelado - Cancelled

    Rate Limits

    Tiny ERP API has rate limits. The node respects these limits and will provide appropriate error messages if limits are exceeded. For high-volume operations, consider implementing delays between requests.

    Troubleshooting

    Common Issues

    1. Authentication Failed

      • Verify your Client ID and Client Secret
      • Ensure the redirect URI matches your n8n instance
      • Check if your OAuth2 application is active
    2. Invalid Endpoint

      • Verify the resource and operation combination
      • Check the Tiny ERP API documentation for endpoint availability
    3. Missing Required Fields

      • Review the required fields for each operation
      • Ensure all mandatory data is provided

    Debug Mode

    Enable debug mode in n8n to see detailed API requests and responses:

    1. Set environment variable: N8N_LOG_LEVEL=debug
    2. Restart n8n
    3. Check logs for detailed API communication

    Contributing

    Contributions are welcome! Please:

    1. Fork the repository
    2. Create a feature branch
    3. Make your changes
    4. Add tests if applicable
    5. Submit a pull request

    License

    This project is licensed under the MIT License - see the LICENSE file for details.

    Support

    Changelog

    v1.0.0

    • Initial release
    • Support for Products, Customers, Orders, Invoices, Stock, Contacts, and Account resources
    • OAuth2 authentication
    • Comprehensive error handling
    • Pagination support

    Note: This is a community-maintained node and is not officially supported by Tiny ERP or n8n. Use at your own discretion and always test thoroughly in a development environment before using in production.