Skip to main content
DELETE
{stores_service_api_base_url}
/
stores
/
{store_id}
/
status
{
  "success": true,
  "message": "<string>",
  "campaign_id": "<string>",
  "deleted_at": "<string>",
  "affected_items": {
    "promotions_deleted": 123,
    "store_associations_removed": 123,
    "historical_records_archived": 123
  },
  "archive_location": "<string>"
}
This endpoint permanently removes a campaign and all its associated data from the system. This includes promotions, store associations, usage statistics, and historical performance data.
Campaign deletion is irreversible. All associated promotions will be deactivated immediately, and historical data will be permanently lost. Consider archiving campaigns instead of deletion for data retention.

Path Parameters

company_id
string
required
The unique identifier of the company that owns the campaign
campaign_id
string
required
The unique identifier of the campaign to delete

Query Parameters

current_local_date
string
Current local date for audit and timezone purposes (e.g., “Nov 15 2024 03:46:34”)
force_delete
boolean
default:"false"
Force deletion even if campaign has active promotions or associations
archive_data
boolean
default:"true"
Whether to create an archive backup before deletion

Response

success
boolean
Indicates whether the deletion was successful
message
string
Confirmation message or error details
campaign_id
string
The ID of the deleted campaign
deleted_at
string
Timestamp when the deletion occurred
affected_items
object
Summary of what was deleted along with the campaign
archive_location
string
Location where archived data was stored (if archive_data=true)

Response Example

{
  "success": true,
  "message": "Campaign successfully deleted",
  "campaign_id": "1000010",
  "deleted_at": "2024-01-15T16:45:00Z",
  "affected_items": {
    "promotions_deleted": 3,
    "store_associations_removed": 5,
    "historical_records_archived": 1247
  },
  "archive_location": "s3://campaign-archives/company-1000058/campaign-1000010-20240115.json"
}
When a campaign is deleted, the following occurs in sequence:
  1. Validation: Verify deletion permissions and campaign status
  2. Promotion Deactivation: Immediately stop all active promotions
  3. Store Disassociation: Remove campaign from all associated stores
  4. Data Archival: Create backup of all campaign data (if enabled)
  5. Record Deletion: Remove campaign and related records from active database
  6. Cache Invalidation: Clear all cached campaign data across systems
  7. Audit Logging: Record deletion event for compliance and tracking
Data Archival: By default, campaign data is archived before deletion. This allows for potential data recovery and historical analysis while removing the campaign from active systems.
Alternative to Deletion: Consider setting campaign status to “inactive” or “archived” instead of deletion to preserve historical data while removing the campaign from customer-facing systems.

Pre-Deletion Checks

Active Promotions Check
  • Verifies if campaign has active promotions
  • Warns about customer impact of immediate deactivation
  • Requires force_delete=true to proceed with active promotions
Store Associations Check
  • Identifies all stores currently using the campaign
  • Estimates impact on store operations
  • Provides list of affected store locations
Historical Data Check
  • Calculates amount of historical data that will be lost
  • Estimates analytics impact
  • Recommends archival before deletion
Dependency Check
  • Identifies other campaigns that reference this campaign
  • Checks for integration dependencies
  • Verifies no business-critical dependencies exist

Use Cases

Campaign Cleanup
  • Remove test or duplicate campaigns
  • Clean up failed campaign launches
  • Eliminate outdated promotional campaigns
Compliance Requirements
  • Delete campaigns containing expired promotional content
  • Remove campaigns with data privacy concerns
  • Comply with data retention policies
System Maintenance
  • Remove campaigns that are causing system issues
  • Clean up campaigns with corrupted data
  • Eliminate campaigns that are no longer relevant
Business Restructuring
  • Delete campaigns from discontinued product lines
  • Remove campaigns from closed store locations
  • Eliminate campaigns that don’t align with new business strategy

Error Responses

Campaign Not Found
{
  "success": false,
  "message": "Campaign not found",
  "error_code": "CAMPAIGN_NOT_FOUND",
  "campaign_id": "invalid-id"
}
Active Promotions Prevent Deletion
{
  "success": false,
  "message": "Cannot delete campaign with active promotions",
  "error_code": "ACTIVE_PROMOTIONS_EXIST",
  "active_promotions": 3,
  "suggestion": "Set force_delete=true to override"
}
Insufficient Permissions
{
  "success": false,
  "message": "Insufficient permissions to delete campaign",
  "error_code": "PERMISSION_DENIED",
  "required_role": "campaign_admin"
}
Dependency Conflict
{
  "success": false,
  "message": "Campaign cannot be deleted due to dependencies",
  "error_code": "DEPENDENCY_CONFLICT",
  "dependencies": [
    "Linked to active store integrations",
    "Referenced by reporting system"
  ]
}
Immediate Impact: Campaign deletion immediately affects all customer-facing systems. Active promotions will stop working instantly, which may impact customer experience and pending orders.

Recovery Options

Archive Recovery
  • Archived data can be restored within 30 days
  • Requires administrative approval
  • May not restore all system integrations
Backup Systems
  • System backups may contain campaign data
  • Recovery requires technical intervention
  • Data consistency cannot be guaranteed
Manual Reconstruction
  • Campaign settings can be manually recreated
  • Historical performance data will be lost
  • Promotions and associations must be rebuilt
I