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

# Archive Customer

Archives a customer, preventing new subscriptions and optionally canceling existing ones.

## Mutation

<CodeGroup>
  ```graphql Mutation theme={null}
  mutation ArchiveCustomer($input: ArchiveCustomerInput!) {
    archiveCustomer(input: $input) {
      customerId
    }
  }
  ```

  ```json Variables theme={null}
  {
    "input": {
      "customerId": "customer-123"
    }
  }
  ```

  ```json Response theme={null}
  {
    "data": {
      "archiveCustomer": {
        "customerId": "customer-123"
      }
    }
  }
  ```
</CodeGroup>

## Parameters

<ParamField body="input" type="ArchiveCustomerInput" required>
  Input for archiving a customer

  <Expandable title="properties">
    <ParamField body="customerId" type="String" required>
      The customer's reference ID
    </ParamField>

    <ParamField body="environmentId" type="UUID">
      Environment ID
    </ParamField>
  </Expandable>
</ParamField>

## Return Type

Returns the archived `Customer` object with the `customerId`.

## Behavior

When a customer is archived:

1. All active subscriptions are canceled
2. Customer cannot create new subscriptions
3. Entitlement checks return `CustomerIsArchived` as access denied reason
4. Customer data is retained but marked as deleted

## Unarchive Customer

To restore an archived customer:

```graphql theme={null}
mutation UnarchiveCustomer($input: UnarchiveCustomerInput!) {
  unarchiveCustomer(input: $input) {
    customerId
    name
    email
  }
}
```

## Common Use Cases

<AccordionGroup>
  <Accordion title="Account deletion">
    Archive customer when they request account deletion.
  </Accordion>

  <Accordion title="Fraud prevention">
    Archive customers flagged for fraudulent activity.
  </Accordion>

  <Accordion title="Churn handling">
    Archive customers who have churned and won't return.
  </Accordion>
</AccordionGroup>

## Related Operations

* [Update Customer](/api-and-sdks/api-reference/mutations/update-customer) - Modify customer
* [Cancel Subscription](/api-and-sdks/api-reference/mutations/cancel-subscription) - Cancel individual subscription
