> ## 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
      summary: Resolve accounting rule
      description: Preview which account codes would be resolved for a given context.
      operationId: resolveAccountingRule
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ledger_id:
                  type: string
                category:
                  type: string
                  enum:
                    - invoice_posted
                    - invoice_settled
                    - revenue_recognition
                    - credit_note_created
                    - accounting_software
                product_id:
                  type: string
                product_type:
                  type: string
                currency:
                  type: string
                country:
                  type: string
                customer_id:
                  type: string
                interval_period:
                  type: string
                interval_count:
                  type: number
              required:
                - ledger_id
                - category
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResolvedAccountingRule'
      security:
        - bearer: []
components:
  schemas:
    ResolvedAccountingRule:
      type: object
      properties:
        revenue_ledger_account_id:
          type:
            - string
            - 'null'
        deferred_revenue_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'
        trace:
          type: array
          items:
            type: object
            properties:
              rule_id:
                type: string
              applied_fields:
                type: array
                items:
                  type: string
            required:
              - rule_id
              - applied_fields
          description: Trace of which rules contributed which 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
        - trace
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````