Actions13
- AI/ML Actions
- ChatGPT Actions
- Communication Actions
- Data Processing Actions
- E-Commerce Actions
- Printing Actions
- Utility Actions
Overview
This node operation allows users to create discount coupons in an e-commerce system via the BCL (presumably a backend coupon library) API. It is useful for automating marketing campaigns, promotions, or customer incentives by programmatically generating coupons with specific conditions such as discount type, usage limits, and validity periods.
Practical examples include:
- Creating a percentage discount coupon valid for new customers.
- Generating fixed amount discounts applicable only on subtotal or total purchase.
- Setting minimum and maximum purchase amounts to restrict coupon applicability.
- Defining usage limits and expiry dates to control coupon lifecycle.
Properties
| Name | Meaning |
|---|---|
| CJ Token | CustomJE API token used for authentication with the service. |
| API Key | BCL API key required to authorize the coupon creation request. |
| Is Active | Boolean flag indicating whether the coupon is currently active and usable. |
| Coupon Code | Unique string code that customers will use to redeem the coupon. |
| Apply To | Specifies what the coupon applies to: either the total order amount or just the subtotal. |
| Discount Type | Type of discount offered: either a percentage off or a fixed amount reduction. |
| Discount Amount | Numeric value representing the discount size (percentage or fixed currency amount). |
| Description | Text description providing details about the coupon's purpose or conditions. |
| Enable Condition | Boolean to enable purchase conditions like minimum and maximum purchase amounts. |
| Minimum Purchase | Minimum purchase amount required to apply the coupon (active only if Enable Condition is true). |
| Maximum Purchase | Maximum purchase amount allowed to apply the coupon (active only if Enable Condition is true). |
| Usage Limit | Maximum number of times this coupon can be redeemed across all customers. |
| Enable Expiry | Boolean to enable start and expiry date restrictions for the coupon. |
| Start Date | Date and time from which the coupon becomes valid (active only if Enable Expiry is true). |
| Expiry Date | Date and time after which the coupon is no longer valid (active only if Enable Expiry is true). |
Output
The node outputs a JSON object representing the response from the BCL API after attempting to create the coupon. This typically includes confirmation of coupon creation, coupon details, or error messages if the creation failed.
No binary data output is involved.
Dependencies
- Requires access to the CustomJE API endpoint
https://api.customje.com/bcl-create-coupon.php. - Needs two credentials: a CustomJE API token and a BCL API key for authorization.
- The node uses HTTP POST requests to communicate with the external API.
- Proper network connectivity and valid credentials are necessary for successful execution.
Troubleshooting
- Invalid Credentials: If the API token or key is incorrect or expired, the API will reject the request. Verify and update credentials.
- Coupon Code Conflicts: Using a coupon code that already exists may cause errors. Use unique codes.
- Date Format Issues: Ensure start and expiry dates are provided in correct ISO 8601 format when enabling expiry.
- Condition Mismatch: If "Enable Condition" is true but min/max purchase values are missing or invalid, the API might reject the coupon.
- Usage Limits: Setting usage limits too low or zero may prevent coupon usability.
- Network Errors: Connectivity issues or API downtime will cause failures; check network and API status.
- Unhandled Operation or Resource: The node throws errors if an unsupported resource or operation is selected.
To resolve errors, review the error message returned in the output JSON, verify input parameters, and ensure all required fields are correctly set.
Links and References
- CustomJE API Documentation (general reference, actual docs not linked in source)
- General best practices for coupon management in e-commerce platforms (varies by platform)
This summary is based solely on static analysis of the provided source code and property definitions.