Skip to main content
POST
{micro_service_base_url}
/
stores
/
company
/
{company_id}
/
campaigns
/
bulk
{
  "success": true,
  "message": "<string>",
  "campaignIds": [
    {}
  ],
  "updates": {},
  "updated_count": 123,
  "failed_updates": [
    {
      "campaign_id": "<string>",
      "error": "<string>",
      "error_code": "<string>"
    }
  ],
  "timestamp": "<string>"
}
This endpoint allows you to apply the same updates to multiple campaigns at once, streamlining campaign management for scenarios where you need to modify several campaigns with identical changes.
Bulk updates are processed as a single transaction. If any campaign update fails, the entire operation is rolled back to maintain data consistency.

Path Parameters

company_id
string
required
The unique identifier of the company that owns the campaigns

Request Body

campaignIds
array
required
Array of campaign IDs to update
updates
object
required
Object containing the updates to apply to all specified campaigns

Response

success
boolean
Indicates whether the bulk update was successful
message
string
Confirmation message or error details
campaignIds
array
Array of campaign IDs that were updated
updates
object
Echo of the updates that were applied
updated_count
integer
Number of campaigns successfully updated
failed_updates
array
Array of campaigns that failed to update with error details
timestamp
string
Timestamp when the bulk update was processed

Request Example

{
  "campaignIds": [
    1000013
  ],
  "updates": {
    "name": "Get the Turkey club combo $10.99",
    "description": "Hey! You can avail the opportunity this time and get benefits by choosing 'Get the Turkey club combo $10.99'",
    "end_date": "2025-03-25",
    "start_date": "2025-12-31",
    "status": "inactive"
  }
}

Response Example

{
  "success": true,
  "message": "Bulk update completed successfully",
  "campaignIds": [
    1000013
  ],
  "updates": {
    "name": "Get the Turkey club combo $10.99",
    "description": "Hey! You can avail the opportunity this time and get benefits by choosing 'Get the Turkey club combo $10.99'",
    "end_date": "2025-03-25",
    "start_date": "2025-12-31",
    "status": "inactive"
  },
  "updated_count": 1,
  "failed_updates": [],
  "timestamp": "2024-01-15T16:45:00Z"
}
The bulk update process follows these steps:
  1. Validation: All campaign IDs are validated for existence and permissions
  2. Pre-Check: Updates are validated against business rules for each campaign
  3. Transaction Start: Database transaction begins to ensure consistency
  4. Sequential Updates: Each campaign is updated in sequence
  5. Error Handling: Any failures trigger rollback of all changes
  6. Confirmation: Successful completion commits all changes
  7. Notification: Affected systems are notified of changes
Transaction Safety: Bulk updates use database transactions to ensure either all campaigns are updated successfully or none are modified, maintaining data consistency.
Performance Consideration: For large numbers of campaigns (>50), consider breaking the update into smaller batches to avoid timeout issues and improve processing speed.

Use Cases

Seasonal Campaign Management
  • Update end dates for all seasonal campaigns
  • Change status of holiday campaigns to inactive
  • Extend successful campaigns across multiple products
Compliance Updates
  • Update campaign descriptions for regulatory compliance
  • Modify campaign terms across all active promotions
  • Apply uniform changes for legal requirements
Brand Standardization
  • Update campaign naming conventions
  • Standardize descriptions across campaigns
  • Apply consistent messaging and branding
Performance Optimization
  • Pause underperforming campaigns simultaneously
  • Extend high-performing campaigns
  • Adjust timing based on analytics insights
Administrative Maintenance
  • Archive completed campaigns
  • Update campaign ownership or management
  • Apply system-wide configuration changes

Error Handling

Partial Failure Response
{
  "success": false,
  "message": "Bulk update completed with errors",
  "campaignIds": [1000013, 1000014, 1000015],
  "updated_count": 2,
  "failed_updates": [
    {
      "campaign_id": "1000015",
      "error": "Campaign not found",
      "error_code": "CAMPAIGN_NOT_FOUND"
    }
  ],
  "timestamp": "2024-01-15T16:45:00Z"
}
Validation Error
{
  "success": false,
  "message": "Validation failed for bulk update",
  "error_code": "VALIDATION_ERROR",
  "validation_errors": [
    {
      "field": "end_date",
      "error": "End date must be after start date"
    }
  ]
}
Transaction Rollback
{
  "success": false,
  "message": "Bulk update failed and was rolled back",
  "error_code": "TRANSACTION_FAILED",
  "rollback_reason": "Database constraint violation",
  "affected_campaigns": 0
}
Impact Assessment: Bulk updates affect multiple campaigns simultaneously. Ensure you understand the impact on active promotions, customer experience, and store operations before proceeding.

Best Practices

Planning
  • Test bulk updates on a small subset first
  • Verify campaign IDs before executing large updates
  • Consider timing of updates relative to customer activity
Data Validation
  • Ensure all update fields are valid for all target campaigns
  • Check date ranges and status transitions for consistency
  • Validate permissions for all campaigns being updated
Monitoring
  • Monitor system performance during large bulk updates
  • Track success rates and error patterns
  • Set up alerts for bulk update failures
Recovery Planning
  • Have rollback procedures ready for failed updates
  • Maintain backups before large bulk operations
  • Document changes for audit and troubleshooting

Limitations

Campaign Limits
  • Maximum 100 campaigns per bulk update request
  • Processing timeout after 5 minutes
  • Memory limitations for very large updates
Field Restrictions
  • Some fields may not be suitable for bulk updates
  • Campaign-specific settings cannot be bulk updated
  • Image uploads not supported in bulk operations
Status Constraints
  • Some status transitions may not be allowed for all campaigns
  • Campaign dependencies may prevent bulk status changes
  • Business rules apply to each campaign individually
I