Method

billTerm.update

Change a billing term.

Changes a billing term. It merges: changing only dueDays keeps the type and the other fields. Any change drops the cached frozen copy, so documents posted afterwards freeze the new rule; documents already posted keep the old one.

Examples

Example: with a copy of the synthetic/business-editable example book open as book.gnucash.

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"billTerm.update","params":{"billTerm":"Net30","dueDays":45}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "name": "Net30",
    "type": "days",
    "dueDays": 45,
    "discountDays": 10,
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash billTerm.update '{"billTerm":"Net30","dueDays":45}'

It prints:

{
  "name": "Net30",
  "type": "days",
  "dueDays": 45,
  "discountDays": 10,
  "…": "…"
}

MCP tool call

Tool call:

{"name":"billTerm.update","arguments":{"billTerm":"Net30","dueDays":45}}

Result:

{
  "structuredContent": {
    "name": "Net30",
    "type": "days",
    "dueDays": 45,
    "discountDays": 10,
    "…": "…"
  }
}

Effect: write, on the Book.

Params

Params of billTerm.update: the fields to change.

  • billTerm (BillTermRef, required): The billing term (visible ones only).
  • name (string or null): New name.
  • description (string or null): New description.
  • type (BillTermTypeWire or null): Days or proximo.
  • dueDays (integer (int64) or null): Days until due, or the proximo due day.
  • discountDays (integer (int64) or null): Discount days, or the proximo discount day.
  • discount (Amount or null): Discount percentage.
  • cutoff (integer (int64) or null): Proximo cutoff day.

Result

A billing term.

  • guid (Guid, required): Its GUID.
  • name (string, required): Its name; frozen copies share their parent's.
  • description (string, required): Description.
  • type (BillTermTypeWire or null): Days or proximo; absent for a term whose type was never set.
  • dueDays (integer (int64), required): Days until due, or the proximo due day.
  • discountDays (integer (int64), required): Discount days, or the proximo discount day.
  • discount (Amount, required): Discount percentage.
  • cutoff (integer (int64), required): Proximo cutoff day.
  • refcount (integer (int64), required): How many customers, vendors and documents use it (always 0 for a frozen copy).
  • invisible (boolean, required): True for frozen copies.
  • parent (Guid or null): The term it is a frozen copy of.
  • child (Guid or null): Its current frozen copy.