Package Information
Available Nodes
Documentation
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.
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
Community Nodes (Recommended)
- Go to Settings > Community Nodes in your n8n instance
- Click Install a community node
- Enter
n8n-nodes-tiny-erp
- Click Install
Manual Installation
- Navigate to your n8n installation directory
- Run:
npm install n8n-nodes-tiny-erp
- Restart your n8n instance
Local Development
- Clone this repository
- Install dependencies:
npm install
- Build the project:
npm run build
- Link to your n8n installation:
npm link
- In your n8n directory:
npm link n8n-nodes-tiny-erp
Prerequisites
Before using this node, you need to:
- Create a Tiny ERP Account: Sign up at Tiny ERP
- Set up OAuth2 Application:
- Go to your Tiny ERP developer console
- Create a new OAuth2 application
- Note down your
Client ID
andClient Secret
- Set the redirect URI to your n8n OAuth callback URL
Configuration
Setting up OAuth2 Credentials
In n8n, go to Credentials
Click Create New Credential
Search for "Tiny OAuth2 API"
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
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": "[email protected]",
"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
- Pendingaprovado
- Approvedproducao
- In Productionenviado
- Shippedentregue
- Deliveredcancelado
- 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
Authentication Failed
- Verify your Client ID and Client Secret
- Ensure the redirect URI matches your n8n instance
- Check if your OAuth2 application is active
Invalid Endpoint
- Verify the resource and operation combination
- Check the Tiny ERP API documentation for endpoint availability
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:
- Set environment variable:
N8N_LOG_LEVEL=debug
- Restart n8n
- Check logs for detailed API communication
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- Issues: GitHub Issues
- Documentation: n8n Community Nodes
- Tiny ERP Support: Tiny ERP Help Center
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.