> ## 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
          enum:
            - flat_fee
            - seat
            - dynamic
            - credit
            - bundle
          description: Product type to resolve against.
          example: flat_fee
        currency:
          type: string
          enum:
            - EUR
            - AED
            - AFN
            - XCD
            - ALL
            - AMD
            - AOA
            - ARS
            - USD
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - XOF
            - BMD
            - BND
            - BOB
            - BRL
            - BSD
            - BTN
            - NOK
            - BWP
            - BYR
            - BZD
            - CAD
            - CDF
            - XAF
            - CHF
            - NZD
            - CLP
            - CNY
            - COP
            - CRC
            - CUP
            - CVE
            - ANG
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EGP
            - MAD
            - ERN
            - ETB
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GTQ
            - GYD
            - HKD
            - HNL
            - HRK
            - HTG
            - HUF
            - IDR
            - ILS
            - INR
            - IQD
            - IRR
            - ISK
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LYD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRO
            - MUR
            - MVR
            - MWK
            - MXN
            - MYR
            - MZN
            - NAD
            - XPF
            - NGN
            - NIO
            - NPR
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - RWF
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLL
            - SOS
            - SRD
            - SSP
            - STD
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TOP
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UGX
            - UYU
            - UZS
            - VEF
            - VND
            - VUV
            - WST
            - YER
            - ZAR
            - ZMW
            - ZWL
          description: Currency code to resolve against.
          example: EUR
        country:
          type: string
          enum:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AQ
            - AR
            - AS
            - AT
            - AU
            - AW
            - AX
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BF
            - BV
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - EH
            - ER
            - ES
            - ES-CE
            - ES-ML
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GS
            - GT
            - GU
            - GW
            - GY
            - HK
            - HM
            - HN
            - HR
            - HT
            - HU
            - IC
            - ID
            - IE
            - IL
            - IM
            - IN
            - IO
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PT-20
            - PT-30
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TF
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - UM
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - XK
            - YE
            - YT
            - ZA
            - ZM
            - ZW
          description: Country code to resolve against.
          example: FR
        tax_scheme:
          type: string
          enum:
            - standard
            - reverse_charge
            - exempt
            - not_eligible
            - manual
          description: Tax scheme to resolve against.
          example: reverse_charge
        tax_territory:
          type: string
          enum:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AQ
            - AR
            - AS
            - AT
            - AU
            - AW
            - AX
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BF
            - BV
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - EH
            - ER
            - ES
            - ES-CE
            - ES-ML
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GS
            - GT
            - GU
            - GW
            - GY
            - HK
            - HM
            - HN
            - HR
            - HT
            - HU
            - IC
            - ID
            - IE
            - IL
            - IM
            - IN
            - IO
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PT-20
            - PT-30
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TF
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - UM
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - XK
            - YE
            - YT
            - ZA
            - ZM
            - ZW
          description: Tax territory country code to resolve against.
          example: FR
        tax_rate_class:
          type: string
          enum:
            - standard_rate
            - reduced_rate
            - reduced_rate_alt
            - super_reduced_rate
            - parking_rate
            - exempt
            - reverse_charge
          description: Tax rate class to resolve against.
          example: standard_rate
        customer_id:
          type: string
          description: Customer ID to resolve against.
          example: cus_abc123def456
        coupon_id:
          type: string
          description: Coupon ID to resolve against.
          example: cpn_abc123def456
        client_provider_id:
          type: string
          description: Client provider ID to resolve against.
          example: clp_abc123def456
        payment_method_type:
          type: string
          enum:
            - card
            - transfer
            - transfer_automated
            - direct_debit
            - direct_debit_ach
            - direct_debit_bacs
            - apple_pay
            - google_pay
            - paypal
            - stripe_link
            - external
          description: Payment method type to resolve against.
          example: card
        bank_account_id:
          type: string
          description: Bank account ID to resolve against.
          example: bac_abc123def456
        invoice_type:
          type: string
          enum:
            - invoice
            - document
          description: >-
            Invoice kind to resolve against. Accepts `invoice` or `document`;
            any other invoice kind is matched as `invoice`.
          example: invoice
        interval_period:
          type: string
          enum:
            - days
            - weeks
            - quarters
            - months
            - years
            - once
            - all
          description: Billing interval period filter (months, years, etc.).
          example: months
        interval_count:
          type: number
          description: Billing interval count filter.
          example: 1
        custom_properties:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
              - type: string
                format: date-time
                description: >-
                  UTC date time string in the [ISO
                  8601](https://en.wikipedia.org/wiki/ISO_8601) format.
                example: '2024-12-20T16:04:11Z'
              - type: array
                items:
                  type: string
              - type: 'null'
          description: >-
            Invoice custom property values to resolve against, keyed by custom
            property slug. Unknown slugs and null values are ignored. Rules with
            custom property filters never match without them.
          example:
            fee_type: service
      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
        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
        allowance_for_doubtful_accounts_id:
          type:
            - string
            - 'null'
          description: >-
            Allowance for doubtful accounts ledger account ID, set on
            credit_note_created rules.
          example: lac_abc123def456
        provider_fees_expense_ledger_account_id:
          type:
            - string
            - 'null'
          description: >-
            Expense ledger account ID debited for payment provider fees when a
            payment settles.
          example: lac_abc123def456
        payment_processing_fees_expense_ledger_account_id:
          type:
            - string
            - 'null'
          description: >-
            Expense ledger account ID debited for payment processing fees when a
            payment settles. Takes precedence over
            `provider_fees_expense_ledger_account_id` when set by the same or a
            higher priority rule.
          example: lac_abc123def456
        payment_processing_fees_revenue_ledger_account_id:
          type:
            - string
            - 'null'
          description: >-
            Payment processing fees revenue ledger account ID, set on
            invoice_settled rules.
          example: lac_abc123def456
        customer_credits_ledger_account_id:
          type:
            - string
            - 'null'
          description: Customer credits ledger account ID used for credit balances.
          example: lac_abc123def456
        rev_rec_method:
          type:
            - string
            - 'null'
          enum:
            - none
            - point_in_time
            - over_time
            - usage_based
            - milestone
            - manual
          description: Revenue recognition method.
          example: over_time
        rev_rec_granularity:
          type:
            - string
            - 'null'
          enum:
            - day
            - month
            - quarter
            - year
          description: >-
            Recognition period granularity. Used when `rev_rec_method` is
            `over_time`.
          example: month
        rev_rec_point_in_time_basis:
          type:
            - string
            - 'null'
          enum:
            - invoice_date
            - service_start_date
            - service_end_date
            - custom_date
          description: >-
            Date revenue is recognized on. Used when `rev_rec_method` is
            `point_in_time`.
          example: service_end_date
        discount_recognition_method:
          type:
            - string
            - 'null'
          enum:
            - immediate
            - deferred
            - use_net_amount
          description: Method used to recognize discounts.
          example: deferred
        journal_id:
          type:
            - string
            - 'null'
          description: Journal ID used to route entries in the accounting provider.
          example: jou_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
        - 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
        - allowance_for_doubtful_accounts_id
        - provider_fees_expense_ledger_account_id
        - payment_processing_fees_expense_ledger_account_id
        - payment_processing_fees_revenue_ledger_account_id
        - customer_credits_ledger_account_id
        - rev_rec_method
        - rev_rec_granularity
        - rev_rec_point_in_time_basis
        - discount_recognition_method
        - journal_id
        - trace
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.