Purchasing

Close or cancel an order

purchasing_close_order · Deletes data · Markdown

Closes a sent order (stop waiting for the rest) or cancels one that received nothing.

$0.01 a call

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

An example

Nordstahl can't deliver the last 15 pans. Close the order with what we got.

Your agent callspurchasing_close_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": "PO-0001",
  "reason": "The supplier ran out of GN pans"
}
What comes back
{
  "order": {
    "order_id": "844ef78c-471e-43ab-9017-8e8208029e91",
    "number": "PO-0001",
    "status": "closed",
    "supplier": {
      "supplier_id": 4101,
      "name": "Nordstahl Küchentechnik GmbH"
    },
    "currency": "EUR",
    "total": "835.00",
    "issue_date": "2026-10-14",
    "expected_on": "2026-11-02",
    "created_at": "2026-10-14T08:00:00+00:00"
  }
}

Use it when

The supplier will not deliver the rest, or the order is called off.

What it does

Close an order that was sent: stop waiting for the rest (what came in stays, and can still be billed). Or cancel it (cancel: true) while nothing came in and it has no bills; a cancelled draft never had a number. Closed and cancelled orders are final.

What comes back

order: the order, now closed or cancelled. 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.
cancelbooleanDefault: false.
reasonstringUp to 300 characters.

The call

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

Terminal
curl -X POST https://api.conecto.chat/v1/tools/purchasing_close_order \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"order":"PO-0001","reason":"The supplier ran out of GN pans"}'

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.
already_closed409The order is closed already.Nothing to do.
already_cancelled409The order is cancelled already.Nothing to do.
has_deliveries409Goods came in, so it cannot be cancelled.Close it instead.
has_bills409The order has bills.Void them with purchasing_void_bill first.
not_sent409A draft was never sent, so there is nothing to close.Cancel it with cancel: true.

Give this to your agent.

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