Purchasing

Change a draft order, or mark it sent

purchasing_update_order · Changes data · Markdown

Changes a draft order, or records it as sent without emailing it.

$0.01 a call

From your agent’s balance. A call that fails costs nothing.

An example

Make that 60 GN pans instead of 40 before we send the order.

Your agent callspurchasing_update_order$0.01 a call

The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.

With these arguments
{
  "order": "8a4c2e6f-1b3d-4f5a-9c7e-0d2b4f6a8c1e",
  "lines": [
    {
      "sku": "GN-PAN-11",
      "quantity": 60,
      "unit_cost": "18.50"
    },
    {
      "description": "Delivery",
      "unit_cost": "95.00"
    }
  ]
}
What comes back
{
  "order": {
    "order_id": "8a4c2e6f-1b3d-4f5a-9c7e-0d2b4f6a8c1e",
    "number": null,
    "status": "draft",
    "supplier": {
      "supplier_id": 4101,
      "name": "Nordstahl Küchentechnik GmbH"
    },
    "currency": "EUR",
    "total": "1205.00",
    "issue_date": null,
    "expected_on": "2026-11-02",
    "created_at": "2026-10-14T08:00:00+00:00",
    "lines": [
      {
        "line": 1,
        "sku": "GN-PAN-11",
        "description": "GN 1/1 pan, steel, 65 mm",
        "quantity": "60",
        "unit_cost": "18.5",
        "tax_rate": "0",
        "amount": "1110.00",
        "tax": "0.00",
        "received": "0",
        "billed": "0",
        "to_receive": "60"
      },
      {
        "line": 2,
        "sku": null,
        "description": "Delivery",
        "quantity": "1",
        "unit_cost": "95",
        "tax_rate": "0",
        "amount": "95.00",
        "tax": "0.00",
        "received": "0",
        "billed": "0",
        "to_receive": "1"
      }
    ],
    "subtotal": "1205.00",
    "tax": "0.00",
    "location": "Main",
    "notes": "Please deliver to the warehouse gate, Billbrookdeich 112.",
    "pdf": null,
    "bills": [],
    "sent_at": null,
    "closed_at": null,
    "history": [
      {
        "at": "2026-10-14T08:00:00+00:00",
        "event": "created",
        "detail": "",
        "by": "key 4101 (Pip)"
      },
      {
        "at": "2026-10-14T08:00:00+00:00",
        "event": "changed",
        "detail": "",
        "by": "key 4101 (Pip)"
      }
    ]
  }
}

Use it when

A draft changes before it goes out, or it was sent some other way (phone, the supplier's portal).

What it does

Change a draft: its supplier, lines (they replace the old ones), currency, expected delivery date, stock location or notes. mark_sent: true records it as sent without emailing anyone (you sent it some other way): it takes the next number (PO-0001 on, without gaps) and its PDF is made. A sent order no longer changes; to email it, use purchasing_send_order instead.

What comes back

order: the order as it now is (numbered and with its PDF when marked sent). Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
orderRequiredstringThe order_id, or the order's number like "PO-0007". 1 to 40 characters.
supplierinteger or stringA supplier_id, or the supplier's name. 1 to 200 characters, at least 1.
linesarray of objects1 to 200 items.
lines[].skustringAn Inventory item's SKU: received stock comes into Inventory. Its name is the default description. Up to 64 characters.
lines[].descriptionstringWhat is bought. Lines after the first print smaller, underneath. Up to 2,000 characters.
lines[].quantitynumber or stringDefault 1. Up to 6 decimals. Up to 24 characters.
lines[].unit_costRequirednumber or stringThe cost of one before tax, e.g. "12.50". Up to 24 characters.
lines[].tax_ratenumber or stringTax percent on the line, e.g. 19. Default 0. Up to 24 characters.
currencystringISO 4217, e.g. "EUR". Default: the supplier's. Matches ^[A-Za-z]{3}$.
expected_onstring or nullYYYY-MM-DD, or null. Matches ^\d{4}-\d{2}-\d{2}$.
locationstringUp to 120 characters.
notesstringUp to 5,000 characters.
mark_sentbooleanDefault: false.

The call

Over MCP, call purchasing_update_order on https://api.conecto.chat/mcp/purchasing. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/purchasing_update_order \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"order":"8a4c2e6f-1b3d-4f5a-9c7e-0d2b4f6a8c1e","lines":[{"sku":"GN-PAN-11","quantity":60,"unit_cost":"18.50"},{"description":"Delivery","unit_cost":"95.00"}]}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
not_found404No purchase order has that order_id or number.Find it with purchasing_list_orders.
not_found404No supplier of the business has that supplier_id or name.Call purchasing_list_suppliers, or add the supplier with purchasing_save_supplier.
not_found404A line's SKU is not an Inventory item, or the location does not exist.Add the item with inventory_save_items, or leave the SKU out.
archived409The supplier, item, location or account is archived.Bring the supplier back with purchasing_save_supplier archived: false, or use another one.
invalid_input400A date or currency is not valid.Send dates like 2026-11-02 and currencies like EUR.
not_draft409The order was sent, so it no longer changes.Close or cancel it with purchasing_close_order instead.
invalid_input400Nothing to change was given.Send what changes, or mark_sent: true.
profile_incomplete409The business has no name for documents yet, so no PDF can be made.Set it with invoices_set_profile legal_name.
already_sent409The order was sent already.Nothing to mark.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md