> ## 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.

# Get rule defaults

> Preview default account values and priority for a new accounting rule.



## OpenAPI

````yaml post /v1/accounting/rules/defaults
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/defaults:
    post:
      tags:
        - Accounting > Rules
      summary: Get rule defaults
      description: Preview default account values and priority for a new accounting rule.
      operationId: getRuleDefaults
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ledger_id:
                  type: string
                  description: Identifier of the ledger used to resolve defaults.
                category:
                  type: string
                  enum:
                    - invoice_posted
                    - invoice_settled
                    - revenue_recognition
                    - credit_note_created
                    - accounting_software
                  description: Category of the new accounting rule.
                filters:
                  type: object
                  properties:
                    product_types:
                      type: array
                      items:
                        type: string
                        enum:
                          - flat_fee
                          - dynamic
                          - seat
                          - credit
                      description: Product types matched by the rule.
                    product_ids:
                      type: array
                      items:
                        type: string
                      description: Product identifiers matched by the rule.
                    currencies:
                      type: array
                      items:
                        type: string
                      description: ISO 4217 currencies matched by the rule.
                    countries:
                      type: array
                      items:
                        type: string
                      description: ISO country codes matched by the rule.
                    tax_schemes:
                      type: array
                      items:
                        type: string
                        enum:
                          - standard
                          - reverse_charge
                          - exempt
                          - not_eligible
                          - manual
                      description: Tax schemes matched by the rule.
                    tax_territories:
                      type: array
                      items:
                        type: string
                      description: Tax territories matched by the rule.
                    tax_rate_classes:
                      type: array
                      items:
                        type: string
                        enum:
                          - standard_rate
                          - reduced_rate
                          - reduced_rate_alt
                          - super_reduced_rate
                          - parking_rate
                          - exempt
                          - reverse_charge
                      description: Tax-rate classes matched by the rule.
                    customer_ids:
                      type: array
                      items:
                        type: string
                      description: Customer identifiers matched by the rule.
                    coupon_ids:
                      type: array
                      items:
                        type: string
                      description: Coupon identifiers matched by the rule.
                    client_provider_ids:
                      type: array
                      items:
                        type: string
                      description: Provider connection identifiers matched by the rule.
                    payment_method_types:
                      type: array
                      items:
                        type: string
                        enum:
                          - card
                          - transfer
                          - transfer_automated
                          - direct_debit
                          - direct_debit_ach
                          - direct_debit_bacs
                          - apple_pay
                          - google_pay
                          - stripe_link
                      description: Payment methods matched by the rule.
                    bank_account_ids:
                      type: array
                      items:
                        type: string
                      description: Bank-account identifiers matched by the rule.
                    interval_period:
                      type:
                        - string
                        - 'null'
                      enum:
                        - days
                        - weeks
                        - quarters
                        - months
                        - years
                        - once
                        - all
                      description: Subscription interval unit matched by the rule.
                    interval_count:
                      type:
                        - number
                        - 'null'
                      description: Subscription interval count matched by the rule.
                  description: Optional filters for the proposed rule.
              required:
                - ledger_id
                - category
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  defaults:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        value:
                          type:
                            - string
                            - 'null'
                          description: Resolved default value.
                        rule_id:
                          type:
                            - string
                            - 'null'
                          description: Identifier of the source rule.
                        rule_name:
                          type:
                            - string
                            - 'null'
                          description: Name of the source rule.
                        rule_code:
                          type:
                            - string
                            - 'null'
                          description: Code of the source rule.
                      required:
                        - value
                        - rule_id
                        - rule_name
                        - rule_code
                    description: Suggested accounting defaults by field.
                  suggested_priority:
                    type: number
                    description: Suggested priority for the new rule.
                  trace:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Resolved accounting field.
                        value:
                          type:
                            - string
                            - 'null'
                          description: Resolved value for the field.
                        rule_id:
                          type:
                            - string
                            - 'null'
                          description: Identifier of the selected source rule.
                        rule_name:
                          type:
                            - string
                            - 'null'
                          description: Name of the selected source rule.
                        is_ambiguous:
                          type: boolean
                          description: Whether multiple rules matched equally.
                      required:
                        - field
                        - value
                        - rule_id
                        - rule_name
                        - is_ambiguous
                    description: Resolution trace for the suggested defaults.
                  context_count:
                    type: number
                    description: Number of matching contexts used for resolution.
                required:
                  - defaults
                  - suggested_priority
                  - trace
                  - context_count
      security:
        - bearer: []
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````