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

# Close an account

> Permanently close an account. This action cannot be undone. Balance and history remain readable.



## OpenAPI

````yaml post /v1/customer-credits/accounts/{id}/close
openapi: 3.0.0
info:
  title: Creem API
  description: >-
    Creem is an all-in-one platform for managing subscriptions and recurring
    revenue, tailored specifically for today's SaaS companies. It enables you to
    boost revenue, enhance customer retention, and scale your operations
    seamlessly.
  version: v1
  contact:
    name: Creem Support
    url: https://creem.io
    email: support@creem.io
  license:
    name: Commercial
    url: https://creem.io/terms
  termsOfService: https://creem.io/terms
servers:
  - url: https://api.creem.io
    description: Production — live API for processing real transactions and data.
    x-speakeasy-server-id: prod
  - url: https://test-api.creem.io
    description: Test — sandbox API for development and testing with no real charges.
    x-speakeasy-server-id: test
security: []
tags: []
externalDocs:
  description: Creem Documentation
  url: https://docs.creem.io
paths:
  /v1/customer-credits/accounts/{id}/close:
    post:
      tags:
        - Customer Credits - Accounts (Experimental)
      summary: Close an account
      description: Permanently close an account. This action cannot be undone.
      operationId: closeCustomerCreditsAccount
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Account closed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountResponseDto'
        '400':
          description: Bad Request - Invalid input parameters
        '401':
          description: Unauthorized - Invalid or missing API key
        '404':
          description: Not Found - Resource does not exist
        '409':
          description: Account already closed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerCreditsErrorResponseDto'
      security:
        - ApiKey: []
components:
  schemas:
    AccountResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Account ID
          example: cca_abc123
        store_id:
          type: string
          description: Store ID
        customer_id:
          type: string
          description: Owner ID
          example: cust_abc123
        name:
          type: string
          description: Account name
          example: default
        unit_label:
          type: string
          description: Unit label
          example: credits
        status:
          type: string
          description: Account status
          enum:
            - active
            - frozen
            - closed
        created_at:
          type: string
          description: Creation timestamp
        updated_at:
          type: string
          description: Last update timestamp
      required:
        - id
        - store_id
        - customer_id
        - name
        - unit_label
        - status
        - created_at
        - updated_at
    CustomerCreditsErrorResponseDto:
      type: object
      properties:
        error:
          description: Error details
          allOf:
            - $ref: '#/components/schemas/CustomerCreditsErrorDetailDto'
      required:
        - error
    CustomerCreditsErrorDetailDto:
      type: object
      properties:
        type:
          type: string
          description: Error category
          enum:
            - invalid_request_error
            - api_error
            - authentication_error
            - rate_limit_error
          example: invalid_request_error
        code:
          type: object
          description: Machine-readable error code
          example: unbalanced_transaction
          nullable: true
        message:
          type: string
          description: Human-readable error message
          example: Total debits must equal total credits
        param:
          type: object
          description: The parameter related to the error, if applicable
          example: entries
          nullable: true
        request_id:
          type: string
          description: Unique request identifier for support
          example: req_abc123def456
      required:
        - type
        - code
        - message
        - request_id
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. You can find your API key in the Creem
        dashboard under Settings > API Keys.

````