Skip to main content
POST
/
v1
/
accounting
/
rules
Create accounting rule
curl --request POST \
  --url https://api.hyperline.co/v1/accounting/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "category": "invoice_posted",
  "priority": 123,
  "ledger_id": "<string>",
  "name": "<string>",
  "product_ids": [],
  "product_types": [],
  "customer_ids": [],
  "currencies": [],
  "countries": [],
  "coupon_ids": [],
  "client_provider_ids": [],
  "payment_method_types": [],
  "interval_period": "<string>",
  "interval_count": 123,
  "revenue_ledger_account_id": "<string>",
  "deferred_revenue_ledger_account_id": "<string>",
  "deferred_discount_ledger_account_id": "<string>",
  "contra_revenue_ledger_account_id": "<string>",
  "discount_ledger_account_id": "<string>",
  "ar_ledger_account_id": "<string>",
  "cash_ledger_account_id": "<string>",
  "payments_clearing_ledger_account_id": "<string>",
  "output_tax_ledger_account_id": "<string>",
  "bad_debt_expense_ledger_account_id": "<string>",
  "customer_credits_ledger_account_id": "<string>"
}
'
{
  "id": "arl_abc123def456",
  "code": "R-001",
  "name": "Recurring subscriptions",
  "ledger_id": "led_abc123def456",
  "category": "accounting_software",
  "priority": 100,
  "product_ids": [
    "<string>"
  ],
  "product_types": [
    "<string>"
  ],
  "customer_ids": [
    "<string>"
  ],
  "currencies": [
    "<string>"
  ],
  "countries": [
    "<string>"
  ],
  "coupon_ids": [
    "<string>"
  ],
  "client_provider_ids": [
    "<string>"
  ],
  "payment_method_types": [
    "<string>"
  ],
  "interval_period": "<string>",
  "interval_count": 123,
  "revenue_ledger_account_id": "<string>",
  "deferred_revenue_ledger_account_id": "<string>",
  "deferred_discount_ledger_account_id": "<string>",
  "contra_revenue_ledger_account_id": "<string>",
  "discount_ledger_account_id": "<string>",
  "ar_ledger_account_id": "<string>",
  "cash_ledger_account_id": "<string>",
  "payments_clearing_ledger_account_id": "<string>",
  "output_tax_ledger_account_id": "<string>",
  "bad_debt_expense_ledger_account_id": "<string>",
  "customer_credits_ledger_account_id": "<string>",
  "created_at": "2023-12-25",
  "updated_at": "2023-12-25",
  "revenue_ledger_account": {
    "id": "<string>",
    "code": "<string>",
    "name": "<string>",
    "client_provider_id": "<string>",
    "provider": {
      "name": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
category
enum<string> | null
required
Available options:
invoice_posted,
invoice_settled,
revenue_recognition,
credit_note_created,
accounting_software
priority
number
required
ledger_id
string
name
string | null
product_ids
string[]
product_types
string[]
customer_ids
string[]
currencies
string[]
countries
string[]
coupon_ids
string[]
client_provider_ids
string[]
payment_method_types
string[]
interval_period
string | null
interval_count
number | null
revenue_ledger_account_id
string | null
deferred_revenue_ledger_account_id
string | null
deferred_discount_ledger_account_id
string | null
contra_revenue_ledger_account_id
string | null
discount_ledger_account_id
string | null
ar_ledger_account_id
string | null
cash_ledger_account_id
string | null
payments_clearing_ledger_account_id
string | null
output_tax_ledger_account_id
string | null
bad_debt_expense_ledger_account_id
string | null
customer_credits_ledger_account_id
string | null

Response

201 - application/json
id
string
required

Unique identifier of the accounting rule.

Example:

"arl_abc123def456"

code
string
required

Auto-generated rule code (e.g. R-001).

Example:

"R-001"

name
string | null
required

Optional user-defined name for the rule.

Example:

"Recurring subscriptions"

ledger_id
string
required

Identifier of the ledger this rule belongs to.

Example:

"led_abc123def456"

category
string | null
required

Rule category (e.g. accounting_software, invoice_posted).

Example:

"accounting_software"

priority
number
required

Override order. Higher priority wins when multiple rules match.

Example:

100

product_ids
string[]
required

Product IDs to match. Empty means match all.

product_types
string[]
required

Product types to match (seat, flat_fee, dynamic, etc.).

customer_ids
string[]
required

Customer IDs for customer-specific overrides.

currencies
string[]
required

Currency codes to match (e.g. EUR, USD).

countries
string[]
required

Country codes for jurisdiction-based overrides.

coupon_ids
string[]
required

Coupon IDs to match. Empty means match all.

client_provider_ids
string[]
required

Client provider IDs to match. Empty means match all.

payment_method_types
string[]
required

Payment method types to match. Empty means match all.

interval_period
string | null
required

Billing interval period filter (month, year, etc.).

interval_count
number | null
required

Billing interval count filter.

revenue_ledger_account_id
string | null
required

Revenue ledger account ID.

deferred_revenue_ledger_account_id
string | null
required
deferred_discount_ledger_account_id
string | null
required
contra_revenue_ledger_account_id
string | null
required
discount_ledger_account_id
string | null
required
ar_ledger_account_id
string | null
required
cash_ledger_account_id
string | null
required
payments_clearing_ledger_account_id
string | null
required
output_tax_ledger_account_id
string | null
required
bad_debt_expense_ledger_account_id
string | null
required
customer_credits_ledger_account_id
string | null
required
created_at
string<date>
required

Timestamp when the rule was created.

updated_at
string<date>
required

Timestamp when the rule was last updated.

revenue_ledger_account
object