Delete Campaign
curl --request DELETE \
--url 'https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status'import requests
url = "https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"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>"
}Campaigns
Delete Campaign
Delete a campaign and all associated data including promotions, store associations, and historical records.
DELETE
{stores_service_api_base_url}
/
stores
/
{store_id}
/
status
Delete Campaign
curl --request DELETE \
--url 'https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status'import requests
url = "https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{{stores_service_api_base_url}}/stores/{{store_id}}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"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
string
required
The unique identifier of the company that owns the campaign
string
required
The unique identifier of the campaign to delete
Query Parameters
string
Current local date for audit and timezone purposes (e.g., “Nov 15 2024 03:46:34”)
boolean
default:"false"
Force deletion even if campaign has active promotions or associations
boolean
default:"true"
Whether to create an archive backup before deletion
Response
boolean
Indicates whether the deletion was successful
string
Confirmation message or error details
string
The ID of the deleted campaign
string
Timestamp when the deletion occurred
object
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"
}
Deletion Process Workflow
Deletion Process Workflow
When a campaign is deleted, the following occurs in sequence:
- Validation: Verify deletion permissions and campaign status
- Promotion Deactivation: Immediately stop all active promotions
- Store Disassociation: Remove campaign from all associated stores
- Data Archival: Create backup of all campaign data (if enabled)
- Record Deletion: Remove campaign and related records from active database
- Cache Invalidation: Clear all cached campaign data across systems
- 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
Deletion Safety Checks
Deletion Safety 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
- Identifies all stores currently using the campaign
- Estimates impact on store operations
- Provides list of affected store locations
- Calculates amount of historical data that will be lost
- Estimates analytics impact
- Recommends archival before deletion
- Identifies other campaigns that reference this campaign
- Checks for integration dependencies
- Verifies no business-critical dependencies exist
Use Cases
Common Deletion Scenarios
Common Deletion Scenarios
Campaign Cleanup
- Remove test or duplicate campaigns
- Clean up failed campaign launches
- Eliminate outdated promotional campaigns
- Delete campaigns containing expired promotional content
- Remove campaigns with data privacy concerns
- Comply with data retention policies
- Remove campaigns that are causing system issues
- Clean up campaigns with corrupted data
- Eliminate campaigns that are no longer relevant
- Delete campaigns from discontinued product lines
- Remove campaigns from closed store locations
- Eliminate campaigns that don’t align with new business strategy
Error Responses
Common Error Scenarios
Common Error Scenarios
Campaign Not FoundActive Promotions Prevent DeletionInsufficient PermissionsDependency Conflict
{
"success": false,
"message": "Campaign not found",
"error_code": "CAMPAIGN_NOT_FOUND",
"campaign_id": "invalid-id"
}
{
"success": false,
"message": "Cannot delete campaign with active promotions",
"error_code": "ACTIVE_PROMOTIONS_EXIST",
"active_promotions": 3,
"suggestion": "Set force_delete=true to override"
}
{
"success": false,
"message": "Insufficient permissions to delete campaign",
"error_code": "PERMISSION_DENIED",
"required_role": "campaign_admin"
}
{
"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
Post-Deletion Recovery
Post-Deletion Recovery
Archive Recovery
- Archived data can be restored within 30 days
- Requires administrative approval
- May not restore all system integrations
- System backups may contain campaign data
- Recovery requires technical intervention
- Data consistency cannot be guaranteed
- Campaign settings can be manually recreated
- Historical performance data will be lost
- Promotions and associations must be rebuilt

