> ## 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 Company

> This endpoint permanently deletes a company from the system. This is a destructive operation that will remove the company and potentially affect all associated stores, orders, and data. Use with extreme caution.

This endpoint permanently removes a company from the system. This is an irreversible operation that will delete the company record and may cascade to associated entities like stores, orders, and customer data.

<Warning>
  **Destructive Operation:** This action cannot be undone. All company data, associated stores, and related information will be permanently deleted from the system.
</Warning>

### Path Parameters

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

### Prerequisites

Before deleting a company, ensure:

<Accordion title="Pre-deletion Checklist">
  <ResponseField name="Backup Data" type="action">
    Export any important company data, reports, or configurations that you may need later
  </ResponseField>

  <ResponseField name="Store Management" type="action">
    Handle all associated stores - either delete them separately or transfer them to another company
  </ResponseField>

  <ResponseField name="Order Processing" type="action">
    Ensure all pending orders are completed or properly handled
  </ResponseField>

  <ResponseField name="Financial Settlement" type="action">
    Complete any outstanding payments, refunds, or billing processes
  </ResponseField>

  <ResponseField name="Customer Communication" type="action">
    Notify customers about service discontinuation if applicable
  </ResponseField>

  <ResponseField name="Integration Cleanup" type="action">
    Disconnect any third-party integrations and clean up API connections
  </ResponseField>
</Accordion>

### Deletion Impact

<Accordion title="What Gets Deleted">
  <ResponseField name="Company Record" type="deleted">
    Complete company profile including business information and settings
  </ResponseField>

  <ResponseField name="Address Information" type="deleted">
    All associated address records
  </ResponseField>

  <ResponseField name="Store Associations" type="affected">
    All stores under this company may be affected (depending on system configuration)
  </ResponseField>

  <ResponseField name="User Access" type="affected">
    Admin and user accounts associated with this company will lose access
  </ResponseField>

  <ResponseField name="Order History" type="affected">
    Historical order data may be affected (check system retention policies)
  </ResponseField>

  <ResponseField name="Integration Data" type="affected">
    HubSpot connections and other CRM integrations will be severed
  </ResponseField>
</Accordion>

### Response

<ResponseField name="success" type="boolean">
  Indicates whether the deletion operation was successful
</ResponseField>

### Response Example

```json theme={null}
{
    "success": true
}
```

### Error Scenarios

<Accordion title="Common Deletion Errors">
  <ResponseField name="Company Not Found" type="error">
    The specified company\_id does not exist in the system

    **Status Code:** 404
  </ResponseField>

  <ResponseField name="Active Stores" type="error">
    Company has active stores that must be handled first

    **Status Code:** 409

    **Solution:** Delete or transfer all stores before deleting the company
  </ResponseField>

  <ResponseField name="Pending Orders" type="error">
    Company has pending or processing orders

    **Status Code:** 409

    **Solution:** Wait for orders to complete or cancel them manually
  </ResponseField>

  <ResponseField name="Insufficient Permissions" type="error">
    User doesn't have permission to delete companies

    **Status Code:** 403

    **Solution:** Ensure you have admin-level permissions
  </ResponseField>
</Accordion>

### Alternative Approaches

<Accordion title="Alternatives to Deletion">
  <ResponseField name="Deactivation" type="alternative">
    Set the company's `active` status to 0 instead of deleting

    **Benefits:** Preserves data while preventing new operations
  </ResponseField>

  <ResponseField name="Status Change" type="alternative">
    Change company status to "Off Boarding" or "Churned"

    **Benefits:** Maintains audit trail and historical data
  </ResponseField>

  <ResponseField name="Archive" type="alternative">
    Export company data before deletion for archival purposes

    **Benefits:** Retains important business information for compliance
  </ResponseField>
</Accordion>

<Tip>
  **Best Practice:** Consider using the Update Company endpoint to set `active: 0` or change status to "Churned" instead of permanent deletion. This preserves valuable business data while effectively removing the company from active operations.
</Tip>

<Note>
  **Compliance:** Ensure deletion complies with data retention policies, GDPR requirements, and any regulatory obligations in your jurisdiction.
</Note>
