Method

customer.get

A customer.

Returns one customer by GUID: its address, currency, default billing term and tax table, discount, credit limit and whether it is active.

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":"customer.get","params":{"customer":"5b22073fa4e34411b07c14a77147ce6b"}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "guid": "5b22073fa4e34411b07c14a77147ce6b",
    "id": "000001",
    "name": "Acme & Sons <Ltd>",
    "currency": "CURRENCY::EUR",
    "taxIncluded": "no",
    "credit": {
      "num": "100000",
      "denom": "100"
    },
    "active": true,
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash customer.get '{"customer":"5b22073fa4e34411b07c14a77147ce6b"}'

It prints:

{
  "guid": "5b22073fa4e34411b07c14a77147ce6b",
  "id": "000001",
  "name": "Acme & Sons <Ltd>",
  "currency": "CURRENCY::EUR",
  "taxIncluded": "no",
  "credit": {
    "num": "100000",
    "denom": "100"
  },
  "active": true,
  "…": "…"
}

MCP tool call

Tool call:

{"name":"customer.get","arguments":{"customer":"5b22073fa4e34411b07c14a77147ce6b"}}

Result:

{
  "structuredContent": {
    "guid": "5b22073fa4e34411b07c14a77147ce6b",
    "id": "000001",
    "name": "Acme & Sons <Ltd>",
    "currency": "CURRENCY::EUR",
    "taxIncluded": "no",
    "credit": {
      "num": "100000",
      "denom": "100"
    },
    "active": true,
    "…": "…"
  }
}

Effect: read.

Params

Names one customer.

  • customer (Guid, required): The customer.

Result

A customer.

  • guid (Guid, required): A GUID: 32 hexadecimal digits.
  • id (string, required)
  • name (string, required)
  • addr (AddressInfo, required): An address. Empty strings are unset fields.
  • shipAddr (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.
  • discount (Amount, required): An exact amount. Read from a decimal string ("12.34"), a rational string ("1234/100") or {num, denom} with string members; written as {num, denom}. Never a JSON number.
  • credit (Amount, required): An exact amount. Read from a decimal string ("12.34"), a rational string ("1234/100") or {num, denom} with string members; written as {num, denom}. Never a JSON number.
  • active (boolean, required)