Actions63
- Authentication Actions
- Tenant Management Actions
- Blog Management Actions
- Image Management Actions
- BuilderX AI Integration Actions
- Form Submissions Actions
- Subscription Management Actions
- Subscription Operations Actions
- Product Family Management Actions
- Feature Management Actions
- Invoice Management Actions
- Payment Management Actions
- Payment Method Management Actions
- Coupon Management Actions
- Health Checks Actions
Overview
The "Create Coupon" operation in the Lectful Central node allows users to create a new coupon associated with a specific price ID in the Lectful Central system. This coupon can optionally pre-fill registration form fields such as email, first name, last name, and company, and can include additional metadata and an expiration date.
This node is beneficial for automating marketing or promotional workflows where coupons need to be generated dynamically and distributed to customers or prospects. For example, an e-commerce platform could use this node to generate discount coupons tied to specific product prices, pre-filling customer information to streamline the checkout process.
Properties
| Name | Meaning |
|---|---|
| Authentication Mode | Choose how to authenticate with the Lectful Central API: - Use Stored Credentials - Manual Configuration (provide base URL and API key manually) |
| Base URL Override | Optional base URL to override the credential setting (used only in Manual Configuration mode). |
| API Key Override | Optional API key to override the credential setting (used only in Manual Configuration mode). |
| Price ID | (Required) The ID of the price this coupon is for. |
| Email address to pre-fill in the registration form (optional). | |
| First Name | First name to pre-fill in the registration form (optional, max 255 characters). |
| Last Name | Last name to pre-fill in the registration form (optional, max 255 characters). |
| Company | Company name to pre-fill in the registration form (optional, max 255 characters). |
| Metadata | Additional metadata for the coupon as a JSON object (optional). |
| Expires At | Expiration date for the coupon; must be a future date (optional). |
Output
The output of the node is a JSON object representing the response from the Lectful Central API after creating the coupon. This typically includes details about the newly created coupon such as its ID, associated price ID, any pre-filled data, metadata, expiration date, and status.
No binary data output is produced by this operation.
Example output structure (simplified):
{
"id": 123,
"price_id": 456,
"email": "user@example.com",
"firstname": "John",
"lastname": "Doe",
"company": "Example Inc.",
"metadata": { "campaign": "spring_sale" },
"expires_at": "2024-12-31T23:59:59Z",
"status": "active",
"token": "abc123xyz"
}
Dependencies
- Requires access to the Lectful Central API.
- Requires either stored credentials configured in n8n or manual entry of the base URL and API key.
- The API key must have permissions to create coupons.
- No additional external dependencies are required.
Troubleshooting
- Missing or invalid credentials: If using stored credentials, ensure they are properly configured with a valid base URL and API key. If using manual mode, both Base URL Override and API Key Override must be provided.
- Invalid JSON in Metadata: If the metadata field contains invalid JSON, the node will skip adding metadata but continue processing. Ensure that the JSON syntax is correct.
- Expiration Date Validation: The expiration date must be a future date. Providing a past date may cause the API to reject the request.
- Required Fields: The Price ID is mandatory. Omitting it will result in an error.
- API Errors: Any errors returned by the Lectful Central API will be surfaced in the node's output. Check the error message for details.
Links and References
- Lectful Central API Documentation (Assumed link, replace with actual if available)
- n8n Documentation on Creating Custom Nodes
- JSON Validator tools for checking metadata JSON correctness (e.g., https://jsonlint.com/)