Documentation
Inventory
inventory.purchase_order
REST
ShippingPOST /api/v1/inventory/purchase_orderMCP tool
Liveinventory.purchase_orderExposed on: REST API · Shop MCP server · Claude connector · Dash (in-app copilot) · Zapier. Part of the Inventory domain.
Operating contract
ONE ORDER IN FULL: the vendor, every line with what was ordered against what has actually been received, and the money — subtotal, shipping, tax and total.
received_quantity AGAINST quantity IS THE WHOLE READ. A line short by two rolls is stock the shop is counting on and does not have, and it is invisible from any total. outstanding is that gap per line, already worked out.
derived_status IS COMPUTED FROM THE LINES, and it can disagree with status, which is the stored column. When they differ, the lines are the truth — the stored status is what somebody last set, and a part-received order that still reads sent is exactly the case worth flagging.
MONEY IS THE ORDER'S OWN. Do not re-add the lines and report the sum as the cost: shipping and tax are on the order, not on its lines, and the landed cost of a roll is line cost plus its share of both.
A ROLL LINE MEASURES IN FEET, not units. unit says which, and quoting '3' for something ordered in feet is a shop ordering three feet of film instead of three rolls.
One order and its lines, entirely returned, so nothing is truncated.
RAISING, SENDING AND RECEIVING AN ORDER ARE NOT HERE. Sending one commits the shop's money with a supplier, and receiving one mints roll codes against physical stock somebody has to be standing next to.
Who may call it
- Permission
inventory.accessThe caller must hold Inventory at the ACT level. A read-only dashboard grant on the same section is refused.- Plan
- Every planNo plan gate. Available on every Service VIN plan.
- Retries
naturalNaturally idempotent — running it twice leaves the same world as running it once. A retrying integration needs no key.- Rate class
readCounted against the read budget — the widest of the four.
Input
| Field | Type | Description |
|---|---|---|
| roll_idrequired | stringuuid | The purchase order's id, as returned by inventory.purchase_orders. (Inventory ids are spelled roll_id across this domain.) |
Output
| Field | Type | Description |
|---|---|---|
| id | string | — |
| number | number | — |
| vendor | string | — |
| vendor_email | string | null | — |
| status | string | — |
| derived_status | string | — |
| expected_on | string | null | — |
| sent_at | string | null | — |
| received_at | string | null | — |
| notes | string | null | — |
| subtotal | number | — |
| shipping | number | — |
| tax | number | — |
| total | number | — |
| lines | object[] | — |
| lines[].id | string | — |
| lines[].description | string | — |
| lines[].sku_id | string | null | — |
| lines[].quantity | number | — |
| lines[].received_quantity | number | — |
| lines[].outstanding | number | — |
| lines[].unit_cost | number | — |
| lines[].line_total | number | — |
| fully_received | boolean | — |
Examples
Built from this capability's own schema — required fields and the ones carrying a default, and nothing invented. Paste one and it validates.
export SERVICEVIN_API_KEY=svk_live_…
curl -X POST https://www.servicevin.com/api/v1/inventory/purchase_order \
-H "Authorization: Bearer $SERVICEVIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"roll_id":"9b2f1c6e-4a77-4d2b-9f31-0f1c9a8e5d20"}'const res = await fetch("https://www.servicevin.com/api/v1/inventory/purchase_order", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SERVICEVIN_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"roll_id": "9b2f1c6e-4a77-4d2b-9f31-0f1c9a8e5d20"
}),
});
// Success and failure are both envelopes. Switch on error.code, never
// on error.message — the codes are stable, the messages are for people.
const payload = await res.json();
if (!res.ok) throw new Error(payload.error.code);
const data = payload.data;import os, requests
res = requests.post(
"https://www.servicevin.com/api/v1/inventory/purchase_order",
headers={"Authorization": f"Bearer {os.environ['SERVICEVIN_API_KEY']}"},
json={
"roll_id": "9b2f1c6e-4a77-4d2b-9f31-0f1c9a8e5d20"
},
timeout=30,
)
payload = res.json()
if not res.ok:
raise RuntimeError(payload["error"]["code"])
data = payload["data"]{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "inventory.purchase_order",
"arguments": {
"roll_id": "9b2f1c6e-4a77-4d2b-9f31-0f1c9a8e5d20"
}
}
}Refusals
The four gates run in this order on every surface, and the order is not arbitrary — see Authentication.
| Status | Code | When |
|---|---|---|
| 404 | not_found | The id is unknown, or the feature is not enabled for this account. Deliberately the same answer for both. |
| 403 | forbidden | This login does not hold inventory.access. |
| 422 | validation_error | An argument was wrong. The message names the field. |
| 429 | rate_limited | Too many read calls. Back off and retry. |
| 500 | internal_error | Something failed on our side. Nothing was changed. |