This endpoint allows you to create comprehensive marketing campaigns for your company. Campaigns can include rich media content, precise scheduling, and detailed targeting criteria to maximize marketing effectiveness.
New campaigns are created in the specified status and can be immediately associated with stores and promotions for complete marketing campaign setup.
Path Parameters
The unique identifier of the company creating the campaign
Request Body
Campaign name for identification and management
Detailed description of the campaign objectives and content
Campaign start date (YYYY-MM-DD format)
Campaign end date (YYYY-MM-DD format)
Campaign status: “active”, “inactive”, “scheduled”, “expired”
Base64 encoded image data for campaign visual assets
Response
Unique campaign identifier
Company identifier this campaign belongs to
URL to the uploaded campaign image
ID of the user who created the campaign
ID of the user who last updated the campaign
Campaign creation timestamp
Campaign last update timestamp
Deletion timestamp (null for active campaigns)
Request Example
{
"description" : "Spring seasonal promotion featuring fresh products and outdoor essentials" ,
"end_date" : "2025-03-25" ,
"start_date" : "2025-12-31" ,
"name" : "Spring Fresh Campaign" ,
"status" : "active" ,
"image" : "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=="
}
Response Example
{
"id" : "1000010" ,
"company_id" : "1000058" ,
"description" : "Spring seasonal promotion featuring fresh products and outdoor essentials" ,
"end_date" : "2025-03-25" ,
"start_date" : "2025-12-31" ,
"name" : "Spring Fresh Campaign" ,
"status" : "active" ,
"image" : "https://lula-stores-service-staging.s3.amazonaws.com/company/1000058/campaigns/1000010/1744591882710.webp" ,
"created_by" : "1000418" ,
"updated_by" : "1000418" ,
"updated_at" : "2025-04-14T00:51:22.994Z" ,
"created_at" : "2025-04-14T00:51:22.994Z" ,
"deletedAt" : null
}
Campaign Creation Workflow
When a campaign is created, the following processes occur:
Validation : Campaign data is validated for completeness and consistency
Image Processing : Base64 image is processed and uploaded to cloud storage
ID Generation : Unique campaign identifier is generated
Database Storage : Campaign details are stored with audit information
Status Initialization : Campaign is set to specified initial status
Availability Setup : Campaign becomes available for store association and promotion creation
Image Processing : Campaign images are automatically processed, optimized, and stored in cloud storage. The response includes the final image URL for use in marketing materials.
Date Validation : Ensure end_date is after start_date and both dates are in the future for scheduled campaigns. Past dates are allowed for historical campaign tracking.
Campaign Status Guide
active
Campaign is currently running and accepting customers
Promotions are being applied to qualifying orders
Campaign is visible in customer-facing applications
inactive
Campaign is created but not currently running
Promotions are not being applied
Campaign can be activated when ready
scheduled
Campaign is set to start at a future date
System will automatically activate when start_date arrives
Useful for planned marketing initiatives
expired
Campaign has passed its end_date
No longer accepting new customers
Historical data remains available for analysis
Error Responses
Invalid Date Range {
"error" : "Invalid date range" ,
"message" : "End date must be after start date" ,
"code" : "INVALID_DATE_RANGE"
}
Company Not Found {
"error" : "Company not found" ,
"message" : "The specified company does not exist" ,
"code" : "COMPANY_NOT_FOUND"
}
Image Processing Error {
"error" : "Image processing failed" ,
"message" : "Unable to process the provided image data" ,
"code" : "IMAGE_PROCESSING_ERROR"
}
Validation Error {
"error" : "Validation failed" ,
"message" : "Required fields are missing or invalid" ,
"code" : "VALIDATION_ERROR" ,
"details" : {
"name" : "Campaign name is required" ,
"description" : "Description cannot be empty"
}
}
Image Size : Campaign images should be optimized for web use. Large images may cause processing delays or failures. Recommended maximum size is 2MB.
Use Cases
Common Campaign Scenarios
Seasonal Campaigns
Holiday promotions (Christmas, Halloween, Valentine’s Day)
Seasonal product features (summer drinks, winter clothing)
Weather-based campaigns (rainy day specials, heat wave promotions)
Product Launch Campaigns
New product introductions with special pricing
Limited edition product features
Brand partnership campaigns
Customer Acquisition Campaigns
Welcome campaigns for new customers
Referral program promotions
Social media engagement campaigns
Revenue Optimization Campaigns
Clearance campaigns for slow-moving inventory
Upselling campaigns for high-margin products
Bundle promotion campaigns