Passer au contenu principal
PUT
/
v1
/
accounting
/
rules
/
{id}
Update accounting rule
curl --request PUT \
  --url https://api.hyperline.co/v1/accounting/rules/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "priority": 123,
  "product_ids": [
    "<string>"
  ],
  "product_types": [],
  "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>",
  "journal_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>",
  "journal_id": "<string>",
  "entity_type": "<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>"
    }
  }
}

Autorisations

Authorization
string
header
requis

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

Paramètres de chemin

id
string
requis

Corps

application/json
name
string | null
category
enum<string> | null
Options disponibles:
invoice_posted,
invoice_settled,
revenue_recognition,
credit_note_created,
accounting_software
priority
number
product_ids
string[]
product_types
enum<string>[]
Options disponibles:
flat_fee,
dynamic,
seat,
credit
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
journal_id
string | null
entity_type
enum<string> | null
Options disponibles:
invoice,
payment

Réponse

200 - application/json
id
string
requis

Unique identifier of the accounting rule.

Exemple:

"arl_abc123def456"

code
string
requis

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

Exemple:

"R-001"

name
string | null
requis

Optional user-defined name for the rule.

Exemple:

"Recurring subscriptions"

ledger_id
string
requis

Identifier of the ledger this rule belongs to.

Exemple:

"led_abc123def456"

category
string | null
requis

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

Exemple:

"accounting_software"

priority
number
requis

Override order. Higher priority wins when multiple rules match.

Exemple:

100

product_ids
string[]
requis

Product IDs to match. Empty means match all.

product_types
string[]
requis

Product types to match. Allowed values: flat_fee, dynamic, seat, credit. Empty means match all.

customer_ids
string[]
requis

Customer IDs for customer-specific overrides.

currencies
string[]
requis

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

countries
string[]
requis

Country codes for jurisdiction-based overrides.

coupon_ids
string[]
requis

Coupon IDs to match. Empty means match all.

client_provider_ids
string[]
requis

Client provider IDs to match. Empty means match all.

payment_method_types
string[]
requis

Payment method types to match. Empty means match all.

interval_period
string | null
requis

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

interval_count
number | null
requis

Billing interval count filter.

revenue_ledger_account_id
string | null
requis

Revenue ledger account ID.

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

Timestamp when the rule was created.

updated_at
string<date>
requis

Timestamp when the rule was last updated.

revenue_ledger_account
object