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

# Resolve accounting rule

> Preview which account codes would be resolved for a given context.



## OpenAPI

````yaml post /v1/accounting/rules/resolve
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/resolve:
    post:
      tags:
        - Accounting > Rules
      summary: Resolve accounting rule
      description: Preview which account codes would be resolved for a given context.
      operationId: resolveAccountingRule
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResolveAccountingRuleCommand'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResolvedAccountingRule'
      security:
        - bearer: []
components:
  schemas:
    ResolveAccountingRuleCommand:
      type: object
      properties:
        ledger_id:
          type: string
          description: Identifier of the ledger this rule belongs to.
          example: led_abc123def456
        category:
          type: string
          enum:
            - invoice_posted
            - invoice_settled
            - revenue_recognition
            - credit_note_created
            - accounting_software
          description: Rule category (e.g. accounting_software, invoice_posted).
          example: accounting_software
        product_id:
          type: string
          description: Product ID to resolve against.
          example: prod_abc123def456
        product_type:
          type: string
          description: Product type to resolve against.
          example: flat_fee
        currency:
          type: string
          description: Currency code to resolve against.
          example: EUR
        country:
          type: string
          description: Country code to resolve against.
          example: FR
        customer_id:
          type: string
          description: Customer ID to resolve against.
          example: cus_abc123def456
        interval_period:
          type: string
          description: Billing interval period filter (month, year, etc.).
          example: month
        interval_count:
          type: number
          description: Billing interval count filter.
          example: 1
      required:
        - ledger_id
        - category
    ResolvedAccountingRule:
      type: object
      properties:
        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
        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
        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
        trace:
          type: array
          items:
            type: object
            properties:
              rule_id:
                type: string
                description: Accounting rule ID that contributed resolved fields.
                example: arl_abc123def456
              applied_fields:
                type: array
                items:
                  type: string
                description: Resolved fields contributed by the accounting rule.
                example:
                  - revenueLedgerAccountId
            required:
              - rule_id
              - applied_fields
          description: Trace of which rules contributed which resolved fields.
      required:
        - revenue_ledger_account_id
        - deferred_revenue_ledger_account_id
        - contra_revenue_ledger_account_id
        - discount_ledger_account_id
        - ar_ledger_account_id
        - cash_ledger_account_id
        - uncollectible_debit_ledger_account_id
        - trace
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````