> ## 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 > Rules
      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:
              $ref: '#/components/schemas/UpdateAccountingRuleCommand'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountingRule'
      security:
        - bearer: []
components:
  schemas:
    UpdateAccountingRuleCommand:
      type: object
      properties:
        name:
          type:
            - string
            - 'null'
          description: Optional user-defined name for the rule.
          example: Recurring subscriptions
        category:
          type:
            - string
            - 'null'
          enum:
            - invoice_posted
            - invoice_settled
            - revenue_recognition
            - credit_note_created
            - accounting_software
          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.
          example:
            - prod_abc123def456
        product_types:
          type: array
          items:
            type: string
            enum:
              - flat_fee
              - dynamic
              - seat
              - credit
          description: >-
            Product types to match. Allowed values: flat_fee, dynamic, seat,
            credit. Empty means match all.
          example:
            - flat_fee
        customer_ids:
          type: array
          items:
            type: string
          description: Customer IDs for customer-specific overrides.
          example:
            - cus_abc123def456
        currencies:
          type: array
          items:
            type: string
          description: Currency codes to match (e.g. EUR, USD).
          example:
            - EUR
        countries:
          type: array
          items:
            type: string
          description: Country codes for jurisdiction-based overrides.
          example:
            - FR
        coupon_ids:
          type: array
          items:
            type: string
          description: Coupon IDs to match. Empty means match all.
          example:
            - cpn_abc123def456
        client_provider_ids:
          type: array
          items:
            type: string
          description: Client provider IDs to match. Empty means match all.
          example:
            - clp_abc123def456
        payment_method_types:
          type: array
          items:
            type: string
          description: Payment method types to match. Empty means match all.
          example:
            - card
        interval_period:
          type:
            - string
            - 'null'
          description: Billing interval period filter (month, year, etc.).
          example: month
        interval_count:
          type:
            - number
            - 'null'
          description: Billing interval count filter.
          example: 1
        revenue_ledger_account_id:
          type:
            - string
            - 'null'
          description: Revenue ledger account ID used for invoice line revenue routing.
          example: lac_abc123def456
        deferred_revenue_ledger_account_id:
          type:
            - string
            - 'null'
          description: >-
            Deferred revenue ledger account ID used before revenue is
            recognized.
          example: lac_abc123def456
        deferred_discount_ledger_account_id:
          type:
            - string
            - 'null'
          description: >-
            Deferred discount ledger account ID used before discounts are
            recognized.
          example: lac_abc123def456
        contra_revenue_ledger_account_id:
          type:
            - string
            - 'null'
          description: >-
            Contra revenue ledger account ID used for amounts that reduce
            revenue.
          example: lac_abc123def456
        discount_ledger_account_id:
          type:
            - string
            - 'null'
          description: Discount ledger account ID used for recognized discounts.
          example: lac_abc123def456
        ar_ledger_account_id:
          type:
            - string
            - 'null'
          description: Accounts receivable ledger account ID used for invoice posting.
          example: lac_abc123def456
        cash_ledger_account_id:
          type:
            - string
            - 'null'
          description: Cash ledger account ID used for payment settlement.
          example: lac_abc123def456
        payments_clearing_ledger_account_id:
          type:
            - string
            - 'null'
          description: Payments clearing ledger account ID used while payments settle.
          example: lac_abc123def456
        output_tax_ledger_account_id:
          type:
            - string
            - 'null'
          description: Output tax ledger account ID used for tax liability.
          example: lac_abc123def456
        uncollectible_debit_ledger_account_id:
          type:
            - string
            - 'null'
          description: >-
            Ledger account ID debited when an invoice becomes uncollectible. Use
            an asset account for doubtful-receivable reclassification or an
            expense account for direct write-off.
          example: lac_abc123def456
        customer_credits_ledger_account_id:
          type:
            - string
            - 'null'
          description: Customer credits ledger account ID used for credit balances.
          example: lac_abc123def456
        journal_id:
          type:
            - string
            - 'null'
          description: Journal ID used to route entries in the accounting provider.
          example: jou_abc123def456
        entity_type:
          type:
            - string
            - 'null'
          enum:
            - invoice
            - payment
          description: Entity type the rule applies to.
          example: invoice
    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.
          example:
            - prod_abc123def456
        product_types:
          type: array
          items:
            type: string
          description: >-
            Product types to match. Allowed values: flat_fee, dynamic, seat,
            credit. Empty means match all.
          example:
            - flat_fee
        customer_ids:
          type: array
          items:
            type: string
          description: Customer IDs for customer-specific overrides.
          example:
            - cus_abc123def456
        currencies:
          type: array
          items:
            type: string
          description: Currency codes to match (e.g. EUR, USD).
          example:
            - EUR
        countries:
          type: array
          items:
            type: string
          description: Country codes for jurisdiction-based overrides.
          example:
            - FR
        coupon_ids:
          type: array
          items:
            type: string
          description: Coupon IDs to match. Empty means match all.
          example:
            - cpn_abc123def456
        client_provider_ids:
          type: array
          items:
            type: string
          description: Client provider IDs to match. Empty means match all.
          example:
            - clp_abc123def456
        payment_method_types:
          type: array
          items:
            type: string
          description: Payment method types to match. Empty means match all.
          example:
            - card
        interval_period:
          type:
            - string
            - 'null'
          description: Billing interval period filter (month, year, etc.).
          example: month
        interval_count:
          type:
            - number
            - 'null'
          description: Billing interval count filter.
          example: 1
        revenue_ledger_account_id:
          type:
            - string
            - 'null'
          description: Revenue ledger account ID used for invoice line revenue routing.
          example: lac_abc123def456
        revenue_ledger_account:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              description: Unique identifier of the ledger account.
              example: lac_abc123def456
            code:
              type: string
              description: Accounting code of the ledger account.
              example: '706100'
            name:
              type: string
              description: Display name of the ledger account.
              example: Revenue
            integration:
              type:
                - object
                - 'null'
              properties:
                entity_id:
                  type: string
                  description: ID of the entity in the provider.
                provider_name:
                  type: string
                  enum:
                    - adyen
                    - stripe
                    - mollie
                    - gocardless
                    - airwallex
                    - salesforce
                    - hubspot
                    - attio
                    - xero
                    - pennylane
                    - zoho-books
                    - exact-online
                    - quickbooks
                    - netsuite
                    - datev
                    - anrok
                    - chargebee
                    - slack
                    - plain
                    - zendesk
                    - pylon
                    - intercom
                    - front
                    - helpscout
                    - claap
                    - grain
                    - gong
                    - posthog
                  description: Provider name.
                provider_account_id:
                  type: string
                  description: ID of the connected provider account.
              required:
                - entity_id
                - provider_name
                - provider_account_id
              description: External provider reference associated with the ledger account.
              example:
                entity_id: '123456789'
                provider_name: stripe
                provider_account_id: acc_1234567890
          required:
            - id
            - code
            - name
            - integration
          description: Expanded revenue ledger account reference when available.
        deferred_revenue_ledger_account_id:
          type:
            - string
            - 'null'
          description: >-
            Deferred revenue ledger account ID used before revenue is
            recognized.
          example: lac_abc123def456
        deferred_discount_ledger_account_id:
          type:
            - string
            - 'null'
          description: >-
            Deferred discount ledger account ID used before discounts are
            recognized.
          example: lac_abc123def456
        contra_revenue_ledger_account_id:
          type:
            - string
            - 'null'
          description: >-
            Contra revenue ledger account ID used for amounts that reduce
            revenue.
          example: lac_abc123def456
        discount_ledger_account_id:
          type:
            - string
            - 'null'
          description: Discount ledger account ID used for recognized discounts.
          example: lac_abc123def456
        ar_ledger_account_id:
          type:
            - string
            - 'null'
          description: Accounts receivable ledger account ID used for invoice posting.
          example: lac_abc123def456
        cash_ledger_account_id:
          type:
            - string
            - 'null'
          description: Cash ledger account ID used for payment settlement.
          example: lac_abc123def456
        payments_clearing_ledger_account_id:
          type:
            - string
            - 'null'
          description: Payments clearing ledger account ID used while payments settle.
          example: lac_abc123def456
        output_tax_ledger_account_id:
          type:
            - string
            - 'null'
          description: Output tax ledger account ID used for tax liability.
          example: lac_abc123def456
        uncollectible_debit_ledger_account_id:
          type:
            - string
            - 'null'
          description: >-
            Ledger account ID debited when an invoice becomes uncollectible. Use
            an asset account for doubtful-receivable reclassification or an
            expense account for direct write-off.
          example: lac_abc123def456
        customer_credits_ledger_account_id:
          type:
            - string
            - 'null'
          description: Customer credits ledger account ID used for credit balances.
          example: lac_abc123def456
        journal_id:
          type:
            - string
            - 'null'
          description: Journal ID used to route entries in the accounting provider.
          example: jou_abc123def456
        entity_type:
          type:
            - string
            - 'null'
          description: Entity type the rule applies to.
          example: invoice
        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
        - uncollectible_debit_ledger_account_id
        - customer_credits_ledger_account_id
        - journal_id
        - entity_type
        - created_at
        - updated_at
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````