Skip to main content
DELETE
{promotions_service_api_base_url}
/
promotions
/
company
/
{company_id}
/
campaigns
/
{campaign_id}
/
promotions
/
{promotion_id}
Delete Promotion
curl --request DELETE \
  --url 'https://api.example.com/{{promotions_service_api_base_url}}/promotions/company/{{company_id}}/campaigns/{{campaign_id}}/promotions/{{promotion_id}}' \
  --header 'Content-Type: application/json' \
  --data '
{
  "deletion_reason": "<string>",
  "impact_acknowledgment": true,
  "alternative_actions_considered": [
    {
      "action": "<string>",
      "reason_rejected": "<string>"
    }
  ],
  "data_retention_preferences": {
    "preserve_customer_usage_history": true,
    "preserve_performance_metrics": true,
    "preserve_financial_records": true,
    "anonymize_customer_data": true
  }
}
'
import requests

url = "https://api.example.com/{{promotions_service_api_base_url}}/promotions/company/{{company_id}}/campaigns/{{campaign_id}}/promotions/{{promotion_id}}"

payload = {
"deletion_reason": "<string>",
"impact_acknowledgment": True,
"alternative_actions_considered": [
{
"action": "<string>",
"reason_rejected": "<string>"
}
],
"data_retention_preferences": {
"preserve_customer_usage_history": True,
"preserve_performance_metrics": True,
"preserve_financial_records": True,
"anonymize_customer_data": True
}
}
headers = {"Content-Type": "application/json"}

response = requests.delete(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
deletion_reason: '<string>',
impact_acknowledgment: true,
alternative_actions_considered: [{action: '<string>', reason_rejected: '<string>'}],
data_retention_preferences: {
preserve_customer_usage_history: true,
preserve_performance_metrics: true,
preserve_financial_records: true,
anonymize_customer_data: true
}
})
};

fetch('https://api.example.com/{{promotions_service_api_base_url}}/promotions/company/{{company_id}}/campaigns/{{campaign_id}}/promotions/{{promotion_id}}', 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/{{promotions_service_api_base_url}}/promotions/company/{{company_id}}/campaigns/{{campaign_id}}/promotions/{{promotion_id}}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'deletion_reason' => '<string>',
'impact_acknowledgment' => true,
'alternative_actions_considered' => [
[
'action' => '<string>',
'reason_rejected' => '<string>'
]
],
'data_retention_preferences' => [
'preserve_customer_usage_history' => true,
'preserve_performance_metrics' => true,
'preserve_financial_records' => true,
'anonymize_customer_data' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/{{promotions_service_api_base_url}}/promotions/company/{{company_id}}/campaigns/{{campaign_id}}/promotions/{{promotion_id}}"

payload := strings.NewReader("{\n \"deletion_reason\": \"<string>\",\n \"impact_acknowledgment\": true,\n \"alternative_actions_considered\": [\n {\n \"action\": \"<string>\",\n \"reason_rejected\": \"<string>\"\n }\n ],\n \"data_retention_preferences\": {\n \"preserve_customer_usage_history\": true,\n \"preserve_performance_metrics\": true,\n \"preserve_financial_records\": true,\n \"anonymize_customer_data\": true\n }\n}")

req, _ := http.NewRequest("DELETE", url, payload)

req.Header.Add("Content-Type", "application/json")

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/{{promotions_service_api_base_url}}/promotions/company/{{company_id}}/campaigns/{{campaign_id}}/promotions/{{promotion_id}}")
.header("Content-Type", "application/json")
.body("{\n \"deletion_reason\": \"<string>\",\n \"impact_acknowledgment\": true,\n \"alternative_actions_considered\": [\n {\n \"action\": \"<string>\",\n \"reason_rejected\": \"<string>\"\n }\n ],\n \"data_retention_preferences\": {\n \"preserve_customer_usage_history\": true,\n \"preserve_performance_metrics\": true,\n \"preserve_financial_records\": true,\n \"anonymize_customer_data\": true\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/{{promotions_service_api_base_url}}/promotions/company/{{company_id}}/campaigns/{{campaign_id}}/promotions/{{promotion_id}}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"deletion_reason\": \"<string>\",\n \"impact_acknowledgment\": true,\n \"alternative_actions_considered\": [\n {\n \"action\": \"<string>\",\n \"reason_rejected\": \"<string>\"\n }\n ],\n \"data_retention_preferences\": {\n \"preserve_customer_usage_history\": true,\n \"preserve_performance_metrics\": true,\n \"preserve_financial_records\": true,\n \"anonymize_customer_data\": true\n }\n}"

response = http.request(request)
puts response.read_body
{
  "deletion_id": "<string>",
  "promotion_id": "<string>",
  "campaign_id": "<string>",
  "deletion_status": "<string>",
  "safety_checks": {
    "active_usage_check": {},
    "dependency_check": {},
    "financial_impact_check": {},
    "compliance_check": {}
  },
  "archival_summary": {
    "archived_data_location": "<string>",
    "archived_at": "<string>",
    "archive_retention_period": "<string>",
    "recoverable_until": "<string>"
  },
  "impact_assessment": {
    "customers_affected": 123,
    "orders_impacted": 123,
    "revenue_impact": 123,
    "analytics_impact": {}
  },
  "alternative_recommendations": [
    {
      "recommendation_type": "<string>",
      "description": "<string>",
      "expected_outcome": "<string>"
    }
  ],
  "rollback_options": {
    "recovery_possible": true,
    "recovery_deadline": "<string>",
    "recovery_limitations": [
      {}
    ]
  },
  "compliance_records": {
    "audit_log_entry": "<string>",
    "regulatory_notifications": [
      {}
    ],
    "data_retention_compliance": {}
  },
  "deleted_at": "<string>",
  "deleted_by": "<string>",
  "deletion_method": "<string>"
}
This endpoint provides controlled deletion of promotions with built-in safety mechanisms to prevent accidental loss of valuable marketing data and ensure minimal disruption to ongoing business operations.
Promotion deletion is a permanent action with significant business implications. The system implements multiple safety checks and offers archival options to protect against accidental data loss while maintaining operational integrity.

Path Parameters

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

Query Parameters

force
boolean
default:"false"
Force deletion despite safety warnings (requires elevated permissions)
archive_data
boolean
default:"true"
Whether to archive promotion data before deletion for future reference
transfer_analytics
boolean
default:"true"
Whether to preserve analytics data in campaign-level reporting
confirmation_token
string
Security token required for high-impact deletions

Request Body

deletion_reason
string
required
Business justification for deleting the promotion
impact_acknowledgment
boolean
required
Confirmation that user understands the deletion impact
alternative_actions_considered
array
List of alternative actions considered before deletion
data_retention_preferences
object
Specific preferences for data handling during deletion

Request Example

{
  "deletion_reason": "Promotion was created in error and conflicts with existing campaign strategy. No customer usage has occurred.",
  "impact_acknowledgment": true,
  "alternative_actions_considered": [
    {
      "action": "Pause promotion instead of deletion",
      "reason_rejected": "Promotion was never intended to be active and creates confusion in campaign management"
    },
    {
      "action": "Modify promotion to align with strategy",
      "reason_rejected": "Core concept conflicts with brand guidelines and cannot be salvaged"
    }
  ],
  "data_retention_preferences": {
    "preserve_customer_usage_history": true,
    "preserve_performance_metrics": true,
    "preserve_financial_records": true,
    "anonymize_customer_data": false
  }
}

Response

deletion_id
string
Unique identifier for this deletion operation
promotion_id
string
The ID of the deleted promotion
campaign_id
string
Parent campaign identifier
deletion_status
string
Status of the deletion: “completed”, “archived”, “pending_approval”, “blocked”
safety_checks
object
Results of pre-deletion safety validations
archival_summary
object
Summary of data preservation actions taken
impact_assessment
object
Comprehensive analysis of deletion effects
alternative_recommendations
array
System-generated recommendations for similar promotions
rollback_options
object
Available options for reversing the deletion
compliance_records
object
Compliance and audit trail information
deleted_at
string
Timestamp when the deletion was completed
deleted_by
string
User who performed the deletion
deletion_method
string
Method used for deletion (soft_delete, archive_delete, hard_delete)

Response Example

{
  "deletion_id": "del_promo_spring_001_20250420",
  "promotion_id": "promo_spring_001",
  "campaign_id": "1000010",
  "deletion_status": "completed",
  "safety_checks": {
    "active_usage_check": {
      "status": "passed",
      "current_active_users": 0,
      "pending_transactions": 0,
      "message": "No active usage detected"
    },
    "dependency_check": {
      "status": "passed",
      "dependent_systems": [],
      "external_references": 0,
      "message": "No system dependencies found"
    },
    "financial_impact_check": {
      "status": "warning",
      "total_revenue_impact": 18450.32,
      "outstanding_commitments": 0,
      "message": "Promotion generated significant revenue but no outstanding commitments"
    },
    "compliance_check": {
      "status": "passed",
      "regulatory_requirements": "met",
      "data_retention_compliance": "compliant",
      "message": "All compliance requirements satisfied"
    }
  },
  "archival_summary": {
    "archived_data_location": "archive://promotions/2025/spring_campaign/promo_spring_001",
    "archived_at": "2025-04-20T16:00:00.000Z",
    "archive_retention_period": "7 years",
    "recoverable_until": "2025-05-20T16:00:00.000Z"
  },
  "impact_assessment": {
    "customers_affected": 189,
    "orders_impacted": 247,
    "revenue_impact": 18450.32,
    "analytics_impact": {
      "historical_reports": "preserved",
      "trend_analysis": "adjusted",
      "comparative_metrics": "normalized"
    }
  },
  "alternative_recommendations": [
    {
      "recommendation_type": "similar_promotion",
      "description": "Create a new seasonal promotion with similar discount structure but updated branding",
      "expected_outcome": "Maintain customer engagement while aligning with current strategy"
    },
    {
      "recommendation_type": "customer_retention",
      "description": "Send targeted offers to customers who used the deleted promotion",
      "expected_outcome": "Minimize customer dissatisfaction from promotion removal"
    }
  ],
  "rollback_options": {
    "recovery_possible": true,
    "recovery_deadline": "2025-05-20T16:00:00.000Z",
    "recovery_limitations": [
      "Some real-time metrics may need recalculation",
      "Customer-facing promotion codes will need regeneration",
      "Integration with external systems may require reactivation"
    ]
  },
  "compliance_records": {
    "audit_log_entry": "audit_2025_04_20_promotion_deletion_001",
    "regulatory_notifications": [],
    "data_retention_compliance": {
      "customer_data": "preserved_as_required",
      "financial_records": "archived_per_policy",
      "analytics_data": "anonymized_and_retained"
    }
  },
  "deleted_at": "2025-04-20T16:00:00.000Z",
  "deleted_by": "marketing_manager_002",
  "deletion_method": "archive_delete"
}
Soft Delete
  • Promotion marked as deleted but data remains in active database
  • Can be easily recovered without data loss
  • Continues to appear in some administrative interfaces
  • Recommended for temporary removal or accidental deletions
Archive Delete
  • Promotion data moved to secure archival storage
  • Active database cleaned of promotion references
  • Requires archive recovery process to restore
  • Balances data protection with system performance
Hard Delete
  • Complete removal of promotion data from all systems
  • Cannot be recovered once completed
  • Only recommended for test data or invalid promotions
  • Requires special authorization and safety overrides
Recovery Window: Deleted promotions can typically be recovered within 30 days using archived data. After this period, recovery may require special procedures or may not be possible.
Best Practice: Before deleting promotions with significant usage history, consider deactivating them instead. This preserves data integrity while removing them from active use.

Safety Check Details

Active Usage Validation
  • Check for customers currently using promotion codes
  • Verify no pending transactions with promotion applied
  • Confirm no scheduled automatic applications
  • Validate no active customer communication references
System Dependency Analysis
  • Scan for integration system references
  • Check analytics dashboard dependencies
  • Verify no automated marketing workflows using promotion
  • Confirm no customer service tool dependencies
Financial Impact Assessment
  • Calculate total revenue generated by promotion
  • Identify any outstanding financial commitments
  • Assess impact on revenue projections
  • Verify no pending refund or adjustment requirements
Compliance and Legal Review
  • Check data retention policy requirements
  • Verify regulatory compliance for deletion
  • Confirm audit trail preservation
  • Validate customer privacy regulation compliance
Business Process Impact
  • Analyze effect on campaign performance metrics
  • Assess impact on customer journey mapping
  • Review effect on A/B testing and experimentation
  • Confirm no impact on loyalty program calculations

Error Responses

Active Usage Prevention
{
  "error": "Cannot delete active promotion",
  "message": "Promotion has 15 customers currently using codes and 3 pending transactions",
  "code": "ACTIVE_USAGE_DETECTED",
  "details": {
    "active_users": 15,
    "pending_transactions": 3,
    "suggested_action": "Deactivate promotion and wait for usage completion"
  }
}
Safety Check Failure
{
  "error": "Safety check failed",
  "message": "Promotion has system dependencies that prevent deletion",
  "code": "SAFETY_CHECK_FAILED",
  "failed_checks": [
    "dependency_check",
    "financial_impact_check"
  ]
}
Insufficient Permissions
{
  "error": "Insufficient permissions",
  "message": "High-impact promotion deletion requires administrator approval",
  "code": "PERMISSION_DENIED",
  "required_permission": "promotion_delete_high_impact"
}
Confirmation Required
{
  "error": "Confirmation token required",
  "message": "This deletion requires additional security confirmation",
  "code": "CONFIRMATION_REQUIRED",
  "confirmation_method": "email_token"
}
High-Impact Deletions: Promotions with significant customer usage, revenue impact, or system dependencies require additional approvals and may be blocked from immediate deletion.

Alternative Actions

Deactivation Instead of Deletion
  • Preserves all historical data and analytics
  • Removes promotion from customer-facing systems
  • Maintains compliance and audit trails
  • Can be reactivated if needed in the future
Archival Without Deletion
  • Moves promotion to archived status
  • Removes from active management interfaces
  • Preserves all data for future reference
  • Maintains complete historical integrity
Modification for Compliance
  • Update promotion to meet current requirements
  • Adjust settings to align with new policies
  • Preserve customer value while ensuring compliance
  • Maintain business continuity
Gradual Phase-Out
  • Reduce promotion visibility over time
  • Stop new customer acquisition
  • Allow existing users to complete usage
  • Minimize disruption to customer experience

Recovery Procedures

Immediate Recovery (0-24 hours)
  • Simple restoration from recent backups
  • Full data integrity preserved
  • Minimal system reconfiguration required
  • Complete restoration of all functionality
Short-term Recovery (1-30 days)
  • Restoration from archived data
  • Some real-time metrics may need recalculation
  • Integration systems may require reactivation
  • Customer codes may need regeneration
Long-term Recovery (30+ days)
  • Complex recovery process required
  • May involve data reconstruction
  • Some real-time data may be lost
  • Requires administrator approval and technical support
Recovery Limitations
  • Real-time usage statistics may reset
  • Some integration configurations may be lost
  • Customer notification may be required
  • Performance metrics may show discontinuity

Business Impact Considerations

Customer Relationship Impact
  • Effect on customer satisfaction and loyalty
  • Impact on repeat purchase behavior
  • Influence on customer lifetime value
  • Potential for negative customer feedback
Financial Implications
  • Loss of promotion-driven revenue
  • Impact on profit margin calculations
  • Effect on budget and forecasting
  • Implications for ROI analysis
Marketing Strategy Effects
  • Impact on campaign performance metrics
  • Effect on customer segmentation
  • Influence on future promotion planning
  • Consequences for brand positioning
Operational Considerations
  • Effect on staff training and procedures
  • Impact on customer service operations
  • Influence on inventory planning
  • Consequences for partner relationships