Skip to main content
POST
{micro_service_base_url}
/
stores
/
company
/
{company_id}
/
campaigns
{
  "id": "<string>",
  "company_id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "start_date": "<string>",
  "end_date": "<string>",
  "status": "<string>",
  "image": "<string>",
  "created_by": "<string>",
  "updated_by": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "deletedAt": "<string>"
}
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

company_id
string
required
The unique identifier of the company creating the campaign

Request Body

name
string
required
Campaign name for identification and management
description
string
required
Detailed description of the campaign objectives and content
start_date
string
required
Campaign start date (YYYY-MM-DD format)
end_date
string
required
Campaign end date (YYYY-MM-DD format)
status
string
required
Campaign status: “active”, “inactive”, “scheduled”, “expired”
image
string
Base64 encoded image data for campaign visual assets

Response

id
string
Unique campaign identifier
company_id
string
Company identifier this campaign belongs to
name
string
Campaign name
description
string
Campaign description
start_date
string
Campaign start date
end_date
string
Campaign end date
status
string
Current campaign status
image
string
URL to the uploaded campaign image
created_by
string
ID of the user who created the campaign
updated_by
string
ID of the user who last updated the campaign
created_at
string
Campaign creation timestamp
updated_at
string
Campaign last update timestamp
deletedAt
string
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
}
When a campaign is created, the following processes occur:
  1. Validation: Campaign data is validated for completeness and consistency
  2. Image Processing: Base64 image is processed and uploaded to cloud storage
  3. ID Generation: Unique campaign identifier is generated
  4. Database Storage: Campaign details are stored with audit information
  5. Status Initialization: Campaign is set to specified initial status
  6. 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

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
I