Actions14
Overview
This node interacts with the Tiny ERP API to retrieve cost information for a specific product. It is useful in scenarios where you need to analyze or report on the historical or current costs associated with a product, such as financial analysis, inventory valuation, or cost tracking over time.
For example, you can use this node to:
- Fetch all cost records of a product within a certain date range.
- Limit the number of cost entries returned for performance or pagination.
- Skip a number of cost records to paginate through large datasets.
Properties
| Name | Meaning |
|---|---|
| Product ID | The unique identifier of the product for which to retrieve cost data. |
| Cost Filters | A collection of filters to refine the cost data retrieval: |
| Start Date | Start date to filter costs from (inclusive). |
| End Date | End date to filter costs until (inclusive). |
| Limit | Maximum number of cost records to return (minimum 1). |
| Offset | Number of cost records to skip, useful for pagination (minimum 0). |
Output
The output JSON contains the cost data retrieved from the Tiny ERP API for the specified product and filters. The structure corresponds directly to the API response for product costs, typically including details such as cost amounts, dates, and related metadata.
No binary data is output by this operation.
Example output snippet (simplified):
{
"costs": [
{
"date": "2023-01-01",
"cost": 10.50,
"currency": "USD",
...
},
...
]
}
Dependencies
- Requires an active connection to the Tiny ERP API.
- Requires an API authentication token configured in n8n credentials (an OAuth2 or API key credential).
- The node uses the
tinyErpApiRequesthelper function to make HTTP requests to the Tiny ERP endpoints.
Troubleshooting
Common issues:
- Invalid or missing Product ID will cause the API request to fail.
- Incorrect date formats in filters may result in errors or no data returned.
- Exceeding API rate limits or network issues can cause request failures.
Error messages:
"The operation \"getCosts\" is not supported!"— indicates a misconfiguration of the operation parameter."The resource \"product\" is not supported!"— indicates a misconfiguration of the resource parameter.- API error responses are passed through; check the message for details like invalid credentials or invalid parameters.
Resolutions:
- Ensure the Product ID is valid and exists in Tiny ERP.
- Use ISO 8601 date format for start and end dates.
- Verify API credentials and permissions.
- Handle pagination using limit and offset to avoid large payloads.
Links and References
- Tiny ERP API Documentation (example link, replace with actual)
- n8n Documentation on Creating Custom Nodes
- General REST API best practices for filtering and pagination