Method

vendor.create

Create a vendor; its ID comes from the book's counter unless given.

Creates a vendor: someone you receive bills from. It needs a company name and a currency, the currency of its bills. Unlike a customer, a vendor has one address, where you pay it, and no discount or credit limit.

Leave id out and the vendor is numbered from the book's gncVendor counter. terms and taxTable take a GUID or the name of a visible billing term or tax table.

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":"vendor.create","params":{"name":"Ink Co","currency":"EUR","id":"V-100"}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "guid": "…",
    "id": "V-100",
    "name": "Ink Co",
    "currency": "CURRENCY::EUR",
    "terms": null,
    "taxIncluded": "useGlobal",
    "active": true,
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash vendor.create '{"name":"Ink Co","currency":"EUR","id":"V-100"}'

It prints:

{
  "guid": "…",
  "id": "V-100",
  "name": "Ink Co",
  "currency": "CURRENCY::EUR",
  "terms": null,
  "taxIncluded": "useGlobal",
  "active": true,
  "…": "…"
}

MCP tool call

Tool call:

{"name":"vendor.create","arguments":{"name":"Ink Co","currency":"EUR","id":"V-100"}}

Result:

{
  "structuredContent": {
    "guid": "…",
    "id": "V-100",
    "name": "Ink Co",
    "currency": "CURRENCY::EUR",
    "terms": null,
    "taxIncluded": "useGlobal",
    "active": true,
    "…": "…"
  }
}

Effect: write, on the Book.

Params

Params of vendor.create. name and currency are required.

  • name (string or null): Company name.
  • id (string or null): Vendor number. On create, absent or empty takes the next number from the book's gncVendor counter.
  • currency (CommodityId or null): The currency of the vendor's documents.
  • addr (AddressParams or null): Payment address.
  • notes (string or null): Notes.
  • terms (BillTermRef or null): Default billing term for new bills, by GUID or name; null for none.
  • taxTable (TaxTableRef or null): Tax table, by GUID or name; null for none.
  • taxTableOverride (boolean or null): New bill lines use taxTable rather than the book's default.
  • taxIncluded (TaxIncludedWire or null): Whether prices include tax by default.
  • active (boolean or null): Active; false deactivates.

Result

A vendor.

  • guid (Guid, required): A GUID: 32 hexadecimal digits.
  • id (string, required)
  • name (string, required)
  • addr (AddressInfo, required): An address. Empty strings are unset fields.
  • notes (string, required)
  • currency (CommodityId or null)
  • terms (Guid or null)
  • taxTable (Guid or null)
  • taxTableOverride (boolean, required)
  • taxIncluded (TaxIncludedWire, required): Whether prices include tax by default for the contact's documents.
  • active (boolean, required)