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

# Update accounting rule

> Update an existing accounting rule.



## OpenAPI

````yaml put /v1/accounting/rules/{id}
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v1/accounting/rules/{id}:
    put:
      tags:
        - Accounting
      summary: Update accounting rule
      description: Update an existing accounting rule.
      operationId: updateAccountingRule
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type:
                    - string
                    - 'null'
                category:
                  type:
                    - string
                    - 'null'
                  enum:
                    - invoice_posted
                    - invoice_settled
                    - revenue_recognition
                    - credit_note_created
                    - accounting_software
                priority:
                  type: number
                product_ids:
                  type: array
                  items:
                    type: string
                product_types:
                  type: array
                  items:
                    type: string
                    enum:
                      - flat_fee
                      - dynamic
                      - seat
                      - credit
                customer_ids:
                  type: array
                  items:
                    type: string
                currencies:
                  type: array
                  items:
                    type: string
                countries:
                  type: array
                  items:
                    type: string
                coupon_ids:
                  type: array
                  items:
                    type: string
                client_provider_ids:
                  type: array
                  items:
                    type: string
                payment_method_types:
                  type: array
                  items:
                    type: string
                interval_period:
                  type:
                    - string
                    - 'null'
                interval_count:
                  type:
                    - number
                    - 'null'
                revenue_ledger_account_id:
                  type:
                    - string
                    - 'null'
                deferred_revenue_ledger_account_id:
                  type:
                    - string
                    - 'null'
                deferred_discount_ledger_account_id:
                  type:
                    - string
                    - 'null'
                contra_revenue_ledger_account_id:
                  type:
                    - string
                    - 'null'
                discount_ledger_account_id:
                  type:
                    - string
                    - 'null'
                ar_ledger_account_id:
                  type:
                    - string
                    - 'null'
                cash_ledger_account_id:
                  type:
                    - string
                    - 'null'
                payments_clearing_ledger_account_id:
                  type:
                    - string
                    - 'null'
                output_tax_ledger_account_id:
                  type:
                    - string
                    - 'null'
                bad_debt_expense_ledger_account_id:
                  type:
                    - string
                    - 'null'
                customer_credits_ledger_account_id:
                  type:
                    - string
                    - 'null'
                journal_id:
                  type:
                    - string
                    - 'null'
                entity_type:
                  type:
                    - string
                    - 'null'
                  enum:
                    - invoice
                    - payment
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountingRule'
      security:
        - bearer: []
components:
  schemas:
    AccountingRule:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the accounting rule.
          example: arl_abc123def456
        code:
          type: string
          description: Auto-generated rule code (e.g. R-001).
          example: R-001
        name:
          type:
            - string
            - 'null'
          description: Optional user-defined name for the rule.
          example: Recurring subscriptions
        ledger_id:
          type: string
          description: Identifier of the ledger this rule belongs to.
          example: led_abc123def456
        category:
          type:
            - string
            - 'null'
          description: Rule category (e.g. accounting_software, invoice_posted).
          example: accounting_software
        priority:
          type: number
          description: Override order. Higher priority wins when multiple rules match.
          example: 100
        product_ids:
          type: array
          items:
            type: string
          description: Product IDs to match. Empty means match all.
        product_types:
          type: array
          items:
            type: string
          description: >-
            Product types to match. Allowed values: flat_fee, dynamic, seat,
            credit. Empty means match all.
        customer_ids:
          type: array
          items:
            type: string
          description: Customer IDs for customer-specific overrides.
        currencies:
          type: array
          items:
            type: string
          description: Currency codes to match (e.g. EUR, USD).
        countries:
          type: array
          items:
            type: string
          description: Country codes for jurisdiction-based overrides.
        coupon_ids:
          type: array
          items:
            type: string
          description: Coupon IDs to match. Empty means match all.
        client_provider_ids:
          type: array
          items:
            type: string
          description: Client provider IDs to match. Empty means match all.
        payment_method_types:
          type: array
          items:
            type: string
          description: Payment method types to match. Empty means match all.
        interval_period:
          type:
            - string
            - 'null'
          description: Billing interval period filter (month, year, etc.).
        interval_count:
          type:
            - number
            - 'null'
          description: Billing interval count filter.
        revenue_ledger_account_id:
          type:
            - string
            - 'null'
          description: Revenue ledger account ID.
        revenue_ledger_account:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            code:
              type: string
            name:
              type: string
            client_provider_id:
              type:
                - string
                - 'null'
            provider:
              type:
                - object
                - 'null'
              properties:
                name:
                  type: string
              required:
                - name
          required:
            - id
            - code
            - name
            - client_provider_id
            - provider
        deferred_revenue_ledger_account_id:
          type:
            - string
            - 'null'
        deferred_discount_ledger_account_id:
          type:
            - string
            - 'null'
        contra_revenue_ledger_account_id:
          type:
            - string
            - 'null'
        discount_ledger_account_id:
          type:
            - string
            - 'null'
        ar_ledger_account_id:
          type:
            - string
            - 'null'
        cash_ledger_account_id:
          type:
            - string
            - 'null'
        payments_clearing_ledger_account_id:
          type:
            - string
            - 'null'
        output_tax_ledger_account_id:
          type:
            - string
            - 'null'
        bad_debt_expense_ledger_account_id:
          type:
            - string
            - 'null'
        customer_credits_ledger_account_id:
          type:
            - string
            - 'null'
        journal_id:
          type:
            - string
            - 'null'
        entity_type:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date
          description: Timestamp when the rule was created.
        updated_at:
          type: string
          format: date
          description: Timestamp when the rule was last updated.
      required:
        - id
        - code
        - name
        - ledger_id
        - category
        - priority
        - product_ids
        - product_types
        - customer_ids
        - currencies
        - countries
        - coupon_ids
        - client_provider_ids
        - payment_method_types
        - interval_period
        - interval_count
        - revenue_ledger_account_id
        - deferred_revenue_ledger_account_id
        - deferred_discount_ledger_account_id
        - contra_revenue_ledger_account_id
        - discount_ledger_account_id
        - ar_ledger_account_id
        - cash_ledger_account_id
        - payments_clearing_ledger_account_id
        - output_tax_ledger_account_id
        - bad_debt_expense_ledger_account_id
        - customer_credits_ledger_account_id
        - journal_id
        - entity_type
        - created_at
        - updated_at
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````