Create purchase

Record a supplier bill as a purchase, as a draft or approved.

MCP tool holded_write → create_purchase

write Confirm

Creates one purchase for a supplier with the number printed on the supplier's bill. Each line needs an expense account, because Holded needs one for the ledger. With approve false, the default, the purchase is saved as a draft. Approving makes Holded create the accounting entry. Optionally attach the bill by link. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: create_purchase
NameTypeDescription
contact_id string required string Supplier contact ID from list_contacts.
document_number string required string The supplier's own document number.
items array required array Lines of the document. Each line has name, description, units, price and tax (the tax as named in Holded). Optional discount in percent per line. Use a product from list_products or a new name.
date date date Bill date. Default: today.
due_date date date Due date.
deduction_date date date Controls the tax period for the deduction.
attachment_url string string HTTPS link to the bill file to attach.
approve boolean boolean true approves the purchase, false saves a draft. Default: false.

tools/call

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "holded_write",
    "arguments": {
      "operation": "create_purchase",
      "arguments": {
        "contact_id": "c_a7731e",
        "document_number": "88213",
        "date": "2026-10-09",
        "due_date": "2026-11-08",
        "items": [
          {
            "name": "Cloud hosting, October",
            "description": "Hosting plan",
            "units": 1,
            "price": 49,
            "tax": "VAT 21%",
            "account": "Software"
          }
        ],
        "approve": false
      }
    }
  }
}

Example response

JSON

{
  "content": [
    {
      "type": "text",
      "text": "{ ... same JSON as structuredContent ... }"
    }
  ],
  "structuredContent": {
    "purchase_id": "pu_5e17",
    "supplier": "Fastcloud Hosting",
    "document_number": "88213",
    "status": "draft",
    "subtotal": 49,
    "tax_total": 10.29,
    "total": 59.29,
    "currency": "EUR",
    "due_date": "2026-11-08"
  },
  "isError": false
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.