Actions20
- Payment Link Actions
- Form Actions
- Coupon Actions
Overview
This node integrates with the BCL Payment API to manage forms and their stock items among other resources. Specifically, the "Update Stock" operation under the "Form" resource allows users to update the stock quantities of multiple items within a form. This is useful in scenarios where you need to keep inventory levels synchronized with sales or supply changes, such as updating available product quantities after restocking or sales events.
Practical examples:
- An e-commerce site using BCL forms to sell products can update stock counts dynamically when new inventory arrives.
- Event organizers managing ticket sales via forms can adjust ticket availability by updating stock quantities.
- Businesses running promotions can reduce stock counts for limited-time offers.
Properties
| Name | Meaning |
|---|---|
| Form ID | The unique identifier of the form whose stock items are to be updated (required). |
| Stock Items | A collection of one or more items, each specifying: |
| - Item ID: The unique identifier of the item to update (required). | |
| - Stock Quantity: The new stock quantity for that item, must be between 0 and 999,999 (required). |
Output
The node outputs JSON data representing the response from the BCL API after attempting to update the stock. The structure corresponds to the API's response format, typically including confirmation of updated stock items or error details if the update failed.
If an error occurs and "Continue On Fail" is enabled, the output will include an object with error information containing:
error: Error message string.statusCode: HTTP status code returned by the API.timestamp: ISO timestamp of the error occurrence.resource: The resource involved ("form").operation: The operation attempted ("updateStock").
No binary data output is produced by this operation.
Dependencies
- Requires an API token credential for authenticating with the BCL Payment API.
- The node makes HTTP requests to the base URL
https://bcl.my/api. - Proper configuration of the API token credential in n8n is necessary for successful authentication.
Troubleshooting
Common issues:
- Missing or invalid API token leading to authentication failures.
- Providing no stock items or an empty list results in an error.
- Invalid form ID or item IDs that do not exist in the system.
- Stock quantities outside the allowed range (0 to 999,999).
Error messages and resolutions:
- Authentication failed: Check that the API token credential is correctly set and valid.
- Validation error: Ensure at least one stock item is provided and all required fields are correctly filled.
- Bad request: Verify that all parameters conform to expected formats and constraints.
- Not found: Confirm that the form ID and item IDs exist in the BCL system.
- Forbidden: Make sure the API token has sufficient permissions.
- Server error: Retry later or contact BCL support if persistent.
Links and References
- BCL Payment API Documentation (assumed official API docs)
- n8n documentation on HTTP Request Node for understanding underlying HTTP calls
- General guidance on managing API credentials securely in n8n: Credentials
If you need summaries for other operations or resources, please provide their names.