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

# Disable a ledger account

> Accounting (beta). Retires an added account that is in use: no new or changed invoice line can name it, while what is booked on it and the invoice lines already naming it stay as they are. It can be enabled again. The default account of a type cannot be disabled.



## OpenAPI

````yaml /openapi3.json patch /v1/ledger_accounts/{id}/disable
openapi: 3.0.0
info:
  title: API Endpoints
  description: >-
    This page allows you to explore the available API endpoints. Select a
    resource (e.g. debtors) and an endpoint (e.g. /v1/debtors) to inspect an
    example response and available parameters. An authorization header
    containing a Bearer token is required, see
    [Authentication](/authentication/authorization).
  version: 1.0.0
servers:
  - url: https://api.paytsoftware.com
    description: Production
  - url: https://demo-api.paytsoftware.com
    description: Demo / testing
security:
  - bearerAuth: []
tags:
  - name: administrations
    description: Operations about administrations
  - name: companies
    description: Operations about companies
  - name: contacts
    description: Operations about contacts
  - name: credit_cases
    description: Operations about credit_cases
  - name: debtors
    description: Operations about debtors
  - name: files
    description: Operations about files
  - name: health_care
    description: Operations about health_cares
  - name: orders
    description: Operations about orders
  - name: order_lines
    description: Operations about order_lines
  - name: invoices
    description: Operations about invoices
  - name: labels
    description: Operations about labels
  - name: ledger_accounts
    description: Operations about ledger_accounts
  - name: messages
    description: Operations about messages
  - name: notes
    description: Operations about notes
  - name: notifications
    description: Operations about notifications
  - name: payments
    description: Operations about payments
  - name: payment_conditions
    description: Operations about payment_conditions
  - name: payment_plans
    description: Operations about payment_plans
  - name: psp_mandates
    description: Operations about psp_mandates
  - name: psp_transactions
    description: Operations about psp_transactions
  - name: sign_up
    description: Operations about sign_ups
  - name: tasks
    description: Operations about tasks
  - name: vat_rates
    description: Operations about vat_rates
paths:
  /v1/ledger_accounts/{id}/disable:
    patch:
      tags:
        - ledger_accounts
      summary: Disable a ledger account
      description: >-
        Accounting (beta). Retires an added account that is in use: no new or
        changed invoice line can name it, while what is booked on it and the
        invoice lines already naming it stay as they are. It can be enabled
        again. The default account of a type cannot be disabled.
      operationId: patchV1LedgerAccountsIdDisable
      parameters:
        - in: path
          name: id
          description: Ledger account identifier
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/patchV1LedgerAccountsIdDisable'
      responses:
        '200':
          description: Ledger account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerApi_V1_LedgerAccountEntity'
        '401':
          description: Not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerApi_ErrorEntity'
        '403':
          description: Access not authorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerApi_ErrorEntity'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerApi_ErrorEntity'
        '422':
          description: >-
            ledger_account: default when it is the default account of its type,
            or accounting is not enabled for this administration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerApi_ErrorEntity'
components:
  requestBodies:
    patchV1LedgerAccountsIdDisable:
      content:
        application/x-www-form-urlencoded:
          schema:
            type: object
            properties:
              administration_id:
                type: string
                description: Administration identifier
              fields:
                type: string
                description: >-
                  JSON object defining fields to receive (e.g {"only":
                  ["field1", {"field2": ["field3"]}]})
            required:
              - administration_id
      required: true
  schemas:
    CustomerApi_V1_LedgerAccountEntity:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier
        code:
          type: string
          description: Account code
        name:
          type: string
          description: Account name
        account_type:
          type: string
          enum:
            - bank
            - outgoing_payments
            - cash
            - pos_payments
            - transfers_in_transit
            - bookkeeping_settlements
            - opening_balances
            - customer_receivables
            - deferred_receivables
            - psp_receivables
            - insurer_receivables
            - accrued_revenue
            - vat_receivables
            - supplier_payables
            - deposit_payables
            - vat_payables
            - deferred_revenue
            - pre_payments
            - unmatched_payments
            - revenue
            - recharges
            - administration_levies
            - interest_levies
            - debt_collection_levies
            - interest_income
            - written_off_credits
            - payment_difference_gains
            - rounding_difference_gains
            - exchange_gains
            - collection_fees
            - psp_costs
            - bank_costs
            - interest_expenses
            - bad_debt
            - payment_difference_losses
            - rounding_difference_losses
            - exchange_losses
          description: >-
            Account type, which determines what Payt books on the account.
            Accounts of type revenue, recharges, deposit_payables can be added.
            An invoice line can book on an account of type revenue, recharges,
            deposit_payables, pre_payments.
        is_default:
          type: boolean
          description: >-
            Whether this is the standard account of its type, which Payt books
            on unless an invoice line names another account
        enabled:
          type: boolean
          description: Whether new invoice lines can choose this account
      required:
        - id
        - code
        - name
        - account_type
        - is_default
        - enabled
      description: CustomerApi_V1_LedgerAccountEntity model
    CustomerApi_ErrorEntity:
      type: object
      properties:
        code:
          type: string
          description: Error code
        message:
          type: string
          description: Error message
      required:
        - code
        - message
      description: CustomerApi_ErrorEntity model
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        OAuth2 access token or static API token. See
        [Authorization](/authentication/authorization) for how to obtain one.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.