n8n node for Tiny ERP API v3 integration with OAuth2 - includes estoque operations
npm install n8n-nodes-tiny-erp-v3This 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.
This node supports the following Tiny ERP resources and operations:
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
1. Navigate to your n8n installation directory
2. Run: npm install n8n-nodes-tiny-erp
3. Restart your n8n instance
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
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
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
``json`
{
"resource": "product",
"operation": "getAll",
"options": {
"limit": 50,
"page": 1
}
}
`json`
{
"resource": "product",
"operation": "search",
"search": "LAPTOP-001",
"options": {
"limit": 10,
"page": 1
}
}
`json`
{
"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"
}
}
`json`
{
"resource": "stock",
"operation": "updateStock",
"productId": "12345",
"stockQuantity": 100
}
`json`
{
"resource": "order",
"operation": "updateStatus",
"id": "67890",
"status": "enviado"
}
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
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
When updating order status, you can use these values:
- pendente - Pendingaprovado
- - Approvedproducao
- - In Productionenviado
- - Shippedentregue
- - Deliveredcancelado
- - Cancelled
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.
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
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
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
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Documentation: n8n Community Nodes
- Tiny ERP Support: Tiny ERP Help Center
---
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.