
Tiny ERP
Actions9
- Products Actions
- Orders Actions
- Users Actions
Overview
The Update Stock operation in the Products resource allows you to modify the inventory levels of a specific product within a designated warehouse (deposit). This node is useful for managing stock movements such as adding new inventory (entries), removing inventory (exits), or setting an absolute stock balance. It supports specifying the deposit either by its ID or name, and optionally includes details like unit price, date/time of movement, and additional observations.
Typical use cases include:
- Recording new stock arrivals to a warehouse.
- Logging stock removals due to sales or damages.
- Adjusting stock balances after physical inventory counts.
- Automating stock updates from external systems or processes.
Example: You receive 10 units of product ID "12345888" into warehouse "deposito central" and want to add this quantity to the current stock with an optional unit price and timestamp.
Properties
| Name | Meaning |
|---|---|
| Product ID | The unique identifier of the product whose stock you want to update. |
| Stock Quantity | The quantity to adjust: positive number to add stock, negative to remove stock, or an absolute value to set the balance. |
| Deposit Selection | Method to identify the warehouse: either by Deposit ID or Deposit Name. |
| Deposit ID | The identifier of the warehouse where the stock update will occur (required if Deposit Selection is "By Deposit ID"). |
| Deposit Name | The name of the warehouse where the stock update will occur (required if Deposit Selection is "By Deposit Name"). |
| Movement Type | Type of stock movement: Entry (adds stock), Exit (removes stock), or Balance (sets absolute stock quantity). |
| Unit Price | Optional unit price associated with the stock movement. |
| Date | Optional date and time of the stock movement; defaults to current date/time if not provided. |
| Observations | Optional free-text field for any notes or comments related to the stock movement. |
Output
The node outputs JSON data representing the result of the stock update operation. This typically includes confirmation details such as updated stock quantities, product and deposit identifiers, timestamps, and any messages returned by the ERP API.
If the operation fails, the output may contain an error message describing the issue.
No binary data output is expected from this operation.
Dependencies
- Requires connection to the Tiny ERP API via an API key credential configured in n8n.
- The node depends on proper configuration of the API authentication to interact with the ERP system.
- Network access to the ERP API endpoint must be available.
Troubleshooting
Common Issues:
- Incorrect or missing Product ID or Deposit information can cause failures.
- Providing a Deposit Name when the system expects a Deposit ID (or vice versa) will result in errors.
- Invalid stock quantity values (e.g., non-numeric or zero) may be rejected.
- Missing required fields like Movement Type or Product ID will cause validation errors.
Error Messages:
"The operation "updateStock" is not supported for resource "products": Indicates a misconfiguration or unsupported operation selection.- API errors related to authentication failure suggest checking the API key credential.
- Validation errors from the ERP API usually specify which input parameter is invalid or missing.
Resolution Tips:
- Double-check all required parameters are correctly filled.
- Ensure the deposit identification method matches the provided deposit information.
- Verify API credentials and network connectivity.
- Use the optional Observations field to log context for easier troubleshooting.
Links and References
- Tiny ERP Official API Documentation (example placeholder link)
- n8n Documentation on Creating Custom Nodes
- General best practices for inventory management and stock control systems.