Purchasing

Draft a purchase order

purchasing_create_order · Changes data · Markdown

Drafts a purchase order to a supplier: lines (with Inventory SKUs if you like), currency, delivery date and stock location.

$0.01 a call

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

An example

Order 40 GN pans at 18.50 each from Nordstahl, plus 95 euros delivery, for early November.

Your agent callspurchasing_create_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
{
  "supplier": "Nordstahl Küchentechnik GmbH",
  "expected_on": "2026-11-02",
  "notes": "Please deliver to the warehouse gate, Billbrookdeich 112.",
  "lines": [
    {
      "sku": "GN-PAN-11",
      "quantity": 40,
      "unit_cost": "18.50"
    },
    {
      "description": "Delivery",
      "unit_cost": "95.00"
    }
  ]
}
What comes back
{
  "order": {
    "order_id": "6f2317c3-2513-44e8-aaed-282b2f32aa67",
    "number": null,
    "status": "draft",
    "supplier": {
      "supplier_id": 4101,
      "name": "Nordstahl Küchentechnik GmbH"
    },
    "currency": "EUR",
    "total": "835.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": "40",
        "unit_cost": "18.5",
        "tax_rate": "0",
        "amount": "740.00",
        "tax": "0.00",
        "received": "0",
        "billed": "0",
        "to_receive": "40"
      },
      {
        "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": "835.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)"
      }
    ]
  }
}

Use it when

The business is about to buy goods it wants to track until they arrive.

What it does

Draft an order to a supplier: lines with an optional Inventory sku (received stock then comes into Inventory at the line's unit cost), a description, quantity, unit cost and tax rate; the currency (default the supplier's), the expected delivery date and the stock location deliveries go to (default Main). A draft changes freely (purchasing_update_order) until it is sent; it has no number yet.

What comes back

order: the draft with its order_id, supplier, status, currency, lines, totals, expected date and location. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
supplierRequiredinteger or stringA supplier_id, or the supplier's name. 1 to 200 characters, at least 1.
linesRequiredarray 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_onstringWhen delivery is expected, YYYY-MM-DD. Matches ^\d{4}-\d{2}-\d{2}$.
locationstringAn Inventory location for received stock. Default: Main. Up to 120 characters.
notesstringPrinted above the lines, e.g. delivery instructions. Up to 5,000 characters.

The call

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

Terminal
curl -X POST https://api.conecto.chat/v1/tools/purchasing_create_order \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"supplier":"Nordstahl Küchentechnik GmbH","expected_on":"2026-11-02","notes":"Please deliver to the warehouse gate, Billbrookdeich 112.","lines":[{"sku":"GN-PAN-11","quantity":40,"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 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.

Give this to your agent.

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