add_credit_note_entry
Add a line item to a credit note, validating the target is a credit note and applying correct account types for customer or vendor credit notes.
Instructions
Add a line item to a credit note.
Mirrors add_invoice_entry / add_bill_entry but
validates the target is in fact a credit note (the slot
flag is the gate). Account type rules match the
non-credit twin: INCOME for customer credit notes,
EXPENSE/ASSET for vendor credit notes. Prices stay
positive — the credit-note flag inverts posting direction
at post time, not at entry-add time.
Args:
credit_note_id: Credit note ID (e.g., "000032").
account: Account path appropriate for the owner type
(INCOME for customer, EXPENSE/ASSET for vendor).
description: Line item description.
quantity: Quantity as decimal string.
price: Unit price as decimal string.
owner_type: Optional "customer" or "vendor"
disambiguator for ID collisions. Usually omitted.
taxtable: Optional taxtable name. Same semantics as
add_invoice_entry; the credit-note flag inverts
tax-split direction at posting time so a refunded
tax-inclusive sale produces a debit to the tax-payable
account.
tax_included: If true, price is gross; pretax
extracted at posting.
notes: Optional per-line notes (max 4096 bytes) — e.g.
the reason this line is being credited.
action: Optional line-type label (GnuCash convention:
"Hours", "Material", "Project").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | ||
| price | Yes | ||
| action | No | ||
| account | Yes | ||
| quantity | Yes | ||
| taxtable | No | ||
| owner_type | No | ||
| description | Yes | ||
| tax_included | No | ||
| credit_note_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |