Actions20
- Payment Link Actions
- Form Actions
- Coupon Actions
Overview
This node integrates with the BCL Payment API to manage coupons among other resources. Specifically, the Coupon - Update operation allows users to modify existing coupon details such as discount amount, type, validity period, usage limits, and activation status.
Typical use cases include:
- Adjusting discount values or types on an existing coupon.
- Enabling or disabling expiry dates or purchase conditions for coupons.
- Activating or deactivating coupons based on business needs.
- Setting minimum or maximum purchase amounts required to apply the coupon.
- Updating coupon metadata like code, description, and usage limits.
For example, a marketing team could automate updating coupon discounts during promotional campaigns or deactivate expired coupons without manual intervention.
Properties
| Name | Meaning |
|---|---|
| Coupon ID | The unique identifier of the coupon to update (required). |
| Update Fields | A collection of fields to update on the coupon. At least one field must be provided. |
The Update Fields collection supports these options:
| Field Name | Meaning |
|---|---|
| Apply To | What the discount applies to: either "Total" or "Items". |
| Code | The coupon code string. |
| Description | Text description of the coupon. |
| Discount Amount | Numeric value of the discount (precision up to 2 decimal places). |
| Discount Type | Type of discount: "Percentage" or "Fixed". |
| Enable Condition | Boolean flag to enable purchase conditions for the coupon. |
| Enable Expiry | Boolean flag to enable expiry date for the coupon. |
| Expiry Date | Date and time when the coupon expires (if enabled). |
| Is Active | Boolean flag indicating if the coupon is active. |
| Max Purchase | Maximum purchase amount allowed to use the coupon. |
| Min Purchase | Minimum purchase amount required to use the coupon. |
| Start Date | Date and time when the coupon becomes valid. |
| Usage Limit | Maximum number of times the coupon can be used. |
Output
The node outputs JSON data representing the updated coupon object returned by the BCL API after a successful update operation. Each item in the output corresponds to one input item processed.
The structure typically includes all coupon properties reflecting the current state after the update, such as coupon ID, code, discount details, active status, expiry info, and usage limits.
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
https://bcl.my/apiendpoints. - Proper configuration of the API token credential in n8n is necessary.
Troubleshooting
Common Issues
- Missing or invalid Coupon ID: The update operation requires a valid coupon ID; omitting or providing an incorrect ID will cause errors.
- Empty update fields: At least one field must be specified to update; otherwise, the node throws an error.
- Invalid field values: Providing invalid data types or out-of-range values (e.g., negative discount amount) may result in validation errors from the API.
- Authentication failures: Using an expired or incorrect API token will cause authentication errors.
Error Messages and Resolutions
- Authentication failed: Check that the API token credential is correctly set and has not expired.
- Validation error: Review the update fields for correctness and completeness; ensure required fields are properly formatted.
- Bad request: Verify that all parameters conform to expected formats and constraints.
- Forbidden: Ensure the API token has sufficient permissions to update coupons.
- Not found: Confirm the coupon ID exists in the system.
- Server error: Retry later or contact BCL support if persistent.
Enabling "Continue On Fail" in the node settings allows processing subsequent items even if some fail.
Links and References
- BCL Payment API Documentation (assumed official API docs)
- n8n documentation on HTTP Request Node for understanding underlying HTTP calls
- General best practices for API authentication and error handling in n8n workflows