> ## Documentation Index
> Fetch the complete documentation index at: https://developer.lulacommerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Promotion

> Delete a promotion with comprehensive safety checks, data archival options, and impact assessment to protect business operations.

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.

<Info>
  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.
</Info>

### Path Parameters

<ParamField path="company_id" type="string" required>
  The unique identifier of the company that owns the promotion
</ParamField>

<ParamField path="campaign_id" type="string" required>
  The unique identifier of the campaign containing the promotion
</ParamField>

<ParamField path="promotion_id" type="string" required>
  The unique identifier of the promotion to delete
</ParamField>

### Query Parameters

<ParamField query="force" type="boolean" optional default="false">
  Force deletion despite safety warnings (requires elevated permissions)
</ParamField>

<ParamField query="archive_data" type="boolean" optional default="true">
  Whether to archive promotion data before deletion for future reference
</ParamField>

<ParamField query="transfer_analytics" type="boolean" optional default="true">
  Whether to preserve analytics data in campaign-level reporting
</ParamField>

<ParamField query="confirmation_token" type="string" optional>
  Security token required for high-impact deletions
</ParamField>

### Request Body

<ParamField body="deletion_reason" type="string" required>
  Business justification for deleting the promotion
</ParamField>

<ParamField body="impact_acknowledgment" type="boolean" required>
  Confirmation that user understands the deletion impact
</ParamField>

<ParamField body="alternative_actions_considered" type="array" optional>
  List of alternative actions considered before deletion

  <Expandable title="Alternative Actions">
    <ParamField body="action" type="string">Alternative action that was considered</ParamField>
    <ParamField body="reason_rejected" type="string">Why this alternative was not chosen</ParamField>
  </Expandable>
</ParamField>

<ParamField body="data_retention_preferences" type="object" optional>
  Specific preferences for data handling during deletion

  <Expandable title="Data Retention Preferences">
    <ParamField body="preserve_customer_usage_history" type="boolean" optional default="true">
      Keep customer usage records for compliance and analytics
    </ParamField>

    <ParamField body="preserve_performance_metrics" type="boolean" optional default="true">
      Maintain aggregated performance data for reporting
    </ParamField>

    <ParamField body="preserve_financial_records" type="boolean" optional default="true">
      Keep financial impact data for accounting purposes
    </ParamField>

    <ParamField body="anonymize_customer_data" type="boolean" optional default="false">
      Remove personally identifiable information while preserving analytics
    </ParamField>
  </Expandable>
</ParamField>

### Request Example

```json theme={null}
{
  "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

<ResponseField name="deletion_id" type="string">
  Unique identifier for this deletion operation
</ResponseField>

<ResponseField name="promotion_id" type="string">
  The ID of the deleted promotion
</ResponseField>

<ResponseField name="campaign_id" type="string">
  Parent campaign identifier
</ResponseField>

<ResponseField name="deletion_status" type="string">
  Status of the deletion: "completed", "archived", "pending\_approval", "blocked"
</ResponseField>

<ResponseField name="safety_checks" type="object">
  Results of pre-deletion safety validations

  <Expandable title="Safety Check Results">
    <ResponseField name="active_usage_check" type="object">
      Verification of current promotion usage
    </ResponseField>

    <ResponseField name="dependency_check" type="object">
      Analysis of systems or processes depending on this promotion
    </ResponseField>

    <ResponseField name="financial_impact_check" type="object">
      Assessment of financial implications
    </ResponseField>

    <ResponseField name="compliance_check" type="object">
      Regulatory and policy compliance verification
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="archival_summary" type="object">
  Summary of data preservation actions taken

  <Expandable title="Archival Summary">
    <ResponseField name="archived_data_location" type="string">
      Reference to archived promotion data
    </ResponseField>

    <ResponseField name="archived_at" type="string">
      Timestamp when data was archived
    </ResponseField>

    <ResponseField name="archive_retention_period" type="string">
      How long archived data will be retained
    </ResponseField>

    <ResponseField name="recoverable_until" type="string">
      Latest date for potential data recovery
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="impact_assessment" type="object">
  Comprehensive analysis of deletion effects

  <Expandable title="Impact Assessment">
    <ResponseField name="customers_affected" type="integer">
      Number of customers who used this promotion
    </ResponseField>

    <ResponseField name="orders_impacted" type="integer">
      Number of orders that included this promotion
    </ResponseField>

    <ResponseField name="revenue_impact" type="number">
      Total revenue associated with deleted promotion
    </ResponseField>

    <ResponseField name="analytics_impact" type="object">
      Effect on reporting and analytics systems
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="alternative_recommendations" type="array">
  System-generated recommendations for similar promotions

  <Expandable title="Recommendations">
    <ResponseField name="recommendation_type" type="string">
      Type of alternative action recommended
    </ResponseField>

    <ResponseField name="description" type="string">
      Detailed recommendation description
    </ResponseField>

    <ResponseField name="expected_outcome" type="string">
      Anticipated result of following the recommendation
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="rollback_options" type="object">
  Available options for reversing the deletion

  <Expandable title="Rollback Options">
    <ResponseField name="recovery_possible" type="boolean">
      Whether promotion can be recovered from archive
    </ResponseField>

    <ResponseField name="recovery_deadline" type="string">
      Latest date for successful recovery
    </ResponseField>

    <ResponseField name="recovery_limitations" type="array">
      Limitations or restrictions on data recovery
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="compliance_records" type="object">
  Compliance and audit trail information

  <Expandable title="Compliance Records">
    <ResponseField name="audit_log_entry" type="string">
      Reference to detailed audit log
    </ResponseField>

    <ResponseField name="regulatory_notifications" type="array">
      Any required regulatory notifications
    </ResponseField>

    <ResponseField name="data_retention_compliance" type="object">
      Compliance with data retention policies
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="deleted_at" type="string">
  Timestamp when the deletion was completed
</ResponseField>

<ResponseField name="deleted_by" type="string">
  User who performed the deletion
</ResponseField>

<ResponseField name="deletion_method" type="string">
  Method used for deletion (soft\_delete, archive\_delete, hard\_delete)
</ResponseField>

### Response Example

```json theme={null}
{
  "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"
}
```

<Accordion title="Deletion Methods Explained">
  **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
</Accordion>

<Note>
  **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.
</Note>

<Tip>
  **Best Practice**: Before deleting promotions with significant usage history, consider deactivating them instead. This preserves data integrity while removing them from active use.
</Tip>

### Safety Check Details

<Accordion title="Comprehensive Safety Validations">
  **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
</Accordion>

### Error Responses

<Accordion title="Deletion Error Scenarios">
  **Active Usage Prevention**

  ```json theme={null}
  {
    "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**

  ```json theme={null}
  {
    "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**

  ```json theme={null}
  {
    "error": "Insufficient permissions",
    "message": "High-impact promotion deletion requires administrator approval",
    "code": "PERMISSION_DENIED",
    "required_permission": "promotion_delete_high_impact"
  }
  ```

  **Confirmation Required**

  ```json theme={null}
  {
    "error": "Confirmation token required",
    "message": "This deletion requires additional security confirmation",
    "code": "CONFIRMATION_REQUIRED",
    "confirmation_method": "email_token"
  }
  ```
</Accordion>

<Warning>
  **High-Impact Deletions**: Promotions with significant customer usage, revenue impact, or system dependencies require additional approvals and may be blocked from immediate deletion.
</Warning>

### Alternative Actions

<Accordion title="Alternatives to Deletion">
  **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
</Accordion>

### Recovery Procedures

<Accordion title="Promotion Recovery Process">
  **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
</Accordion>

### Business Impact Considerations

<Accordion title="Strategic Deletion 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
</Accordion>
