> ## 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 Credit Type

Archives a credit type (custom currency), preventing it from being used for new credit grants.

## Archive Mutation

<CodeGroup>
  ```graphql Mutation theme={null}
  mutation ArchiveCreditType($input: ArchiveCreditTypeInput!) {
    archiveCreditType(input: $input) {
      id
      status
    }
  }
  ```

  ```json Variables theme={null}
  {
    "input": {
      "id": "credit-type-ai-tokens"
    }
  }
  ```

  ```json Response theme={null}
  {
    "data": {
      "archiveCreditType": {
        "id": "credit-type-ai-tokens",
        "status": "ARCHIVED"
      }
    }
  }
  ```
</CodeGroup>

## Archive Parameters

<ParamField body="input" type="ArchiveCreditTypeInput" required>
  Input for archiving a credit type

  <Expandable title="properties">
    <ParamField body="id" type="String" required>
      Credit type reference ID
    </ParamField>

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

<Warning>
  It is not possible to archive a credit type that is in use by an active published plan or add-on. Remove the credit type from those plans and add-ons first, then publish the updated versions before archiving.
</Warning>

## Behavior

When a credit type is archived:

* Customers with an existing credit pool of this type can still view it and consume credits normally. Granting additional credits to the pool is not possible.
* Customers without a credit pool of this type cannot see it or receive credits from it.
* The credit type cannot be used in new plans or add-ons.

Archiving is a soft operation — all credit pool data is retained.

## Unarchive Mutation

<CodeGroup>
  ```graphql Mutation theme={null}
  mutation UnarchiveCreditType($input: UnarchiveCreditTypeInput!) {
    unarchiveCreditType(input: $input) {
      id
      status
    }
  }
  ```

  ```json Variables theme={null}
  {
    "input": {
      "id": "credit-type-ai-tokens"
    }
  }
  ```

  ```json Response theme={null}
  {
    "data": {
      "unarchiveCreditType": {
        "id": "credit-type-ai-tokens",
        "status": "ACTIVE"
      }
    }
  }
  ```
</CodeGroup>

## Unarchive Parameters

<ParamField body="input" type="UnarchiveCreditTypeInput" required>
  Input for unarchiving a credit type

  <Expandable title="properties">
    <ParamField body="id" type="String" required>
      Credit type reference ID
    </ParamField>

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

## Related Operations

* [Create Credit Grant](/api-and-sdks/api-reference/mutations/create-credit-grant) - Grant credits to a customer
* [Void Credit Grant](/api-and-sdks/api-reference/mutations/void-credit-grant) - Void an existing credit grant
