REST endpoints for purchasing in ServFlo: 14 operations with parameters, request and response fields, permissions and curl examples.
Base URL: https://app.servflo.ai/api. Every call needs Authorization: Bearer sfk_… (Authentication ); {organizationId} ($ORGANIZATION_ID in the examples) is your business's id .
GET /organizations/{organizationId}/vendors
Suppliers with their item count, purchase-order count and open orders; active only unless includeInactive. Read-only.
Permission purchasing.manage (Owner, Admin)Risk read, OAuth scope servflo.read. Read: reads only.MCP tool vendors_list (toolset pricebook)
Name In Type Required Description queryquery string No Free-text search over the list's names, numbers and contact details. Up to 200 characters. includeInactivequery boolean or enum No
curl "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /vendors" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields An array of objects:
Field Type Description idstring organizationIdstring namestring contactNamestring or null emailstring or null phonestring or null termsstring or null notesstring or null activeboolean createdAtstring (date-time) updatedAtstring (date-time) itemCountinteger purchaseOrderCountinteger openPurchaseOrdersinteger
POST /organizations/{organizationId}/vendors
Adds a supplier (who purchase orders go to; items may name one). Returns it.
Permission purchasing.manage (Owner, Admin)Risk write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.MCP tool vendors_create (toolset pricebook)
Field Type Required Description namestring Yes Up to 200 characters. contactNamestring or null No Up to 200 characters. emailempty string or string (email) or null No phonestring or null No Up to 100 characters. termsstring or null No Payment terms as agreed, e.g. "Net 30". Up to 200 characters. notesstring or null No activeboolean No Retired vendors (false) leave the pickers.
curl -X POST "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /vendors" \
-H "Authorization: Bearer $SERVFLO_API_KEY " \
-H "Content-Type: application/json" \
-d '{"name":"Dana Whitfield"}'
201: the answer's fields Field Type Description idstring organizationIdstring namestring contactNamestring or null emailstring or null phonestring or null termsstring or null notesstring or null activeboolean createdAtstring (date-time) updatedAtstring (date-time)
GET /organizations/{organizationId}/vendors/{vendorId}
One vendor with its item count and latest 20 purchase orders. Read-only.
Permission purchasing.manage (Owner, Admin)Risk read, OAuth scope servflo.read. Read: reads only.MCP tool vendors_get (toolset pricebook)
Name In Type Required Description vendorIdpath string Yes
curl "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /vendors/{vendorId}" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields Field Type Description idstring organizationIdstring namestring contactNamestring or null emailstring or null phonestring or null termsstring or null notesstring or null activeboolean createdAtstring (date-time) updatedAtstring (date-time) itemCountinteger purchaseOrdersarray of object purchaseOrders[].idstring purchaseOrders[].identifierstring purchaseOrders[].statusenum DRAFT (editable), SENT (ordered; still editable until something arrives), PARTIALLY_RECEIVED, RECEIVED, CANCELLED. One of DRAFT, SENT, PARTIALLY_RECEIVED, RECEIVED, CANCELLED. purchaseOrders[].totalCentsinteger Integer cents. purchaseOrders[].createdAtstring (date-time)
PATCH /organizations/{organizationId}/vendors/{vendorId}
Changes the fields sent; active: false retires it. Returns it.
Permission purchasing.manage (Owner, Admin)Risk write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.MCP tool vendors_update (toolset pricebook)
Name In Type Required Description vendorIdpath string Yes
Field Type Required Description namestring No Up to 200 characters. contactNamestring or null No Up to 200 characters. emailempty string or string (email) or null No phonestring or null No Up to 100 characters. termsstring or null No Payment terms as agreed, e.g. "Net 30". Up to 200 characters. notesstring or null No activeboolean No Retired vendors (false) leave the pickers.
curl -X PATCH "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /vendors/{vendorId}" \
-H "Authorization: Bearer $SERVFLO_API_KEY " \
-H "Content-Type: application/json" \
-d '{"name":"Dana Whitfield","contactName":"string","email":"dana@example.com"}'
200: the answer's fields Field Type Description idstring organizationIdstring namestring contactNamestring or null emailstring or null phonestring or null termsstring or null notesstring or null activeboolean createdAtstring (date-time) updatedAtstring (date-time)
DELETE /organizations/{organizationId}/vendors/{vendorId}
Destructive: deletes a vendor without purchase orders (409 otherwise: retire it). Its items keep existing without a vendor.
Permission purchasing.manage (Owner, Admin)Risk sensitive, OAuth scope servflo.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.MCP tool vendors_delete (toolset pricebook)Approval Over MCP, this tool always waits for your approval in ServFlo. See Approvals .
Name In Type Required Description vendorIdpath string Yes
curl -X DELETE "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /vendors/{vendorId}" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields Field Type Description oktrue
GET /organizations/{organizationId}/purchase-orders
Purchase orders (PO-n) newest first, filtered by status, vendor, job, location or text; with lines and totals. Paged with a total. Read-only.
Permission purchasing.manage (Owner, Admin)Risk read, OAuth scope servflo.read. Read: reads only.MCP tool purchaseOrders_list (toolset pricebook)
Name In Type Required Description statusquery enum No DRAFT (editable), SENT (ordered; still editable until something arrives), PARTIALLY_RECEIVED, RECEIVED, CANCELLED. One of DRAFT, SENT, PARTIALLY_RECEIVED, RECEIVED, CANCELLED. vendorIdquery string No jobIdquery string No locationIdquery string No queryquery string No Free-text search over the list's names, numbers and contact details. Up to 200 characters. limitquery integer No Page size, 1–200. Default 50. offsetquery integer No Rows to skip; the answer's total counts every match. Default 0.
curl "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /purchase-orders" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields Field Type Description itemsarray of object items[].idstring items[].organizationIdstring items[].identifierstring PO-n items[].vendorIdstring items[].locationIdstring items[].jobIdstring or null items[].statusenum DRAFT (editable), SENT (ordered; still editable until something arrives), PARTIALLY_RECEIVED, RECEIVED, CANCELLED. One of DRAFT, SENT, PARTIALLY_RECEIVED, RECEIVED, CANCELLED. items[].expectedDatestring or null items[].notesstring or null items[].subtotalCentsinteger Integer cents. items[].totalCentsinteger Integer cents. items[].sentAtstring (date-time) or null items[].receivedAtstring (date-time) or null items[].cancelledAtstring (date-time) or null items[].createdByUserIdstring or null items[].createdAtstring (date-time) items[].updatedAtstring (date-time) items[].vendorobject items[].vendor.idstring items[].vendor.namestring items[].vendor.contactNamestring or null items[].vendor.emailstring or null items[].vendor.phonestring or null items[].vendor.termsstring or null items[].locationobject items[].location.idstring items[].location.namestring items[].location.kindstring items[].location.addressstring or null items[].jobobject or null items[].job.idstring items[].job.identifierstring items[].job.customerobject items[].linesarray of object items[].lines[].idstring items[].lines[].purchaseOrderIdstring items[].lines[].itemIdstring items[].lines[].descriptionstring items[].lines[].quantitynumber items[].lines[].quantityReceivednumber items[].lines[].unitCostCentsinteger Integer cents. items[].lines[].sortOrderinteger items[].lines[].totalCentsinteger Integer cents. items[].lines[].remainingnumber Still to receive. items[].lines[].itemobject items[].receivedValueCentsinteger What has arrived so far, at the PO's unit costs. items[].lineCountinteger totalinteger
POST /organizations/{organizationId}/purchase-orders
Creates a DRAFT purchase order (PO-n) to a vendor for delivery to a location, optionally for a job; lines of stocked items (MATERIAL / EQUIPMENT) at their cost unless given. Nothing is sent. Returns it.
Permission purchasing.manage (Owner, Admin)Risk write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.MCP tool purchaseOrders_create (toolset pricebook)
Field Type Required Description vendorIdstring Yes From GET /vendors. locationIdstring Yes Where it is delivered (GET /inventory/locations). jobIdstring or null No The job it is bought for: its received cost counts in the job's costing. expectedDateempty string or string or null No notesstring or null No linesarray of object Yes Up to 500 items. lines[].itemIdstring Yes A MATERIAL or EQUIPMENT item (GET /pricebook/items). lines[].quantitynumber Yes At most 1000000. lines[].unitCostCentsinteger No Unit cost in cents; defaults to the item's current cost. 0–100000000. lines[].descriptionstring or null No Defaults to the item's name and vendor part number. Up to 500 characters.
curl -X POST "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /purchase-orders" \
-H "Authorization: Bearer $SERVFLO_API_KEY " \
-H "Content-Type: application/json" \
-d '{"vendorId":"vendor_id","locationId":"location_id","lines":[{"itemId":"item_id","quantity":1}]}'
201: the answer's fields Field Type Description idstring organizationIdstring identifierstring PO-n vendorIdstring locationIdstring jobIdstring or null statusenum DRAFT (editable), SENT (ordered; still editable until something arrives), PARTIALLY_RECEIVED, RECEIVED, CANCELLED. One of DRAFT, SENT, PARTIALLY_RECEIVED, RECEIVED, CANCELLED. expectedDatestring or null notesstring or null subtotalCentsinteger Integer cents. totalCentsinteger Integer cents. sentAtstring (date-time) or null receivedAtstring (date-time) or null cancelledAtstring (date-time) or null createdByUserIdstring or null createdAtstring (date-time) updatedAtstring (date-time) vendorobject vendor.idstring vendor.namestring vendor.contactNamestring or null vendor.emailstring or null vendor.phonestring or null vendor.termsstring or null locationobject location.idstring location.namestring location.kindstring location.addressstring or null jobobject or null job.idstring job.identifierstring job.customerobject job.customer.idstring job.customer.namestring linesarray of object lines[].idstring lines[].purchaseOrderIdstring lines[].itemIdstring lines[].descriptionstring lines[].quantitynumber lines[].quantityReceivednumber lines[].unitCostCentsinteger Integer cents. lines[].sortOrderinteger lines[].totalCentsinteger Integer cents. lines[].remainingnumber Still to receive. lines[].itemobject lines[].item.idstring lines[].item.codestring or null lines[].item.namestring lines[].item.unitstring lines[].item.vendorPartNumberstring or null receivedValueCentsinteger What has arrived so far, at the PO's unit costs.
GET /organizations/{organizationId}/purchase-orders/{purchaseOrderId}
One purchase order with its vendor, delivery location, job, lines (ordered, received, remaining) and totals. Read-only.
Permission purchasing.manage (Owner, Admin)Risk read, OAuth scope servflo.read. Read: reads only.MCP tool purchaseOrders_get (toolset pricebook)
Name In Type Required Description purchaseOrderIdpath string Yes
curl "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /purchase-orders/{purchaseOrderId}" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields Field Type Description idstring organizationIdstring identifierstring PO-n vendorIdstring locationIdstring jobIdstring or null statusenum DRAFT (editable), SENT (ordered; still editable until something arrives), PARTIALLY_RECEIVED, RECEIVED, CANCELLED. One of DRAFT, SENT, PARTIALLY_RECEIVED, RECEIVED, CANCELLED. expectedDatestring or null notesstring or null subtotalCentsinteger Integer cents. totalCentsinteger Integer cents. sentAtstring (date-time) or null receivedAtstring (date-time) or null cancelledAtstring (date-time) or null createdByUserIdstring or null createdAtstring (date-time) updatedAtstring (date-time) vendorobject vendor.idstring vendor.namestring vendor.contactNamestring or null vendor.emailstring or null vendor.phonestring or null vendor.termsstring or null locationobject location.idstring location.namestring location.kindstring location.addressstring or null jobobject or null job.idstring job.identifierstring job.customerobject job.customer.idstring job.customer.namestring linesarray of object lines[].idstring lines[].purchaseOrderIdstring lines[].itemIdstring lines[].descriptionstring lines[].quantitynumber lines[].quantityReceivednumber lines[].unitCostCentsinteger Integer cents. lines[].sortOrderinteger lines[].totalCentsinteger Integer cents. lines[].remainingnumber Still to receive. lines[].itemobject lines[].item.idstring lines[].item.codestring or null lines[].item.namestring lines[].item.unitstring lines[].item.vendorPartNumberstring or null receivedValueCentsinteger What has arrived so far, at the PO's unit costs.
PATCH /organizations/{organizationId}/purchase-orders/{purchaseOrderId}
Changes a DRAFT or SENT order (409 once anything was received); lines replaces every line. Returns it.
Permission purchasing.manage (Owner, Admin)Risk write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.MCP tool purchaseOrders_update (toolset pricebook)
Name In Type Required Description purchaseOrderIdpath string Yes
Field Type Required Description vendorIdstring No From GET /vendors. locationIdstring No Where it is delivered (GET /inventory/locations). jobIdstring or null No The job it is bought for: its received cost counts in the job's costing. expectedDateempty string or string or null No notesstring or null No linesarray of object No Up to 500 items. lines[].itemIdstring Yes A MATERIAL or EQUIPMENT item (GET /pricebook/items). lines[].quantitynumber Yes At most 1000000. lines[].unitCostCentsinteger No Unit cost in cents; defaults to the item's current cost. 0–100000000. lines[].descriptionstring or null No Defaults to the item's name and vendor part number. Up to 500 characters.
curl -X PATCH "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /purchase-orders/{purchaseOrderId}" \
-H "Authorization: Bearer $SERVFLO_API_KEY " \
-H "Content-Type: application/json" \
-d '{"vendorId":"vendor_id","locationId":"location_id","jobId":"job_id"}'
200: the answer's fields Field Type Description idstring organizationIdstring identifierstring PO-n vendorIdstring locationIdstring jobIdstring or null statusenum DRAFT (editable), SENT (ordered; still editable until something arrives), PARTIALLY_RECEIVED, RECEIVED, CANCELLED. One of DRAFT, SENT, PARTIALLY_RECEIVED, RECEIVED, CANCELLED. expectedDatestring or null notesstring or null subtotalCentsinteger Integer cents. totalCentsinteger Integer cents. sentAtstring (date-time) or null receivedAtstring (date-time) or null cancelledAtstring (date-time) or null createdByUserIdstring or null createdAtstring (date-time) updatedAtstring (date-time) vendorobject vendor.idstring vendor.namestring vendor.contactNamestring or null vendor.emailstring or null vendor.phonestring or null vendor.termsstring or null locationobject location.idstring location.namestring location.kindstring location.addressstring or null jobobject or null job.idstring job.identifierstring job.customerobject job.customer.idstring job.customer.namestring linesarray of object lines[].idstring lines[].purchaseOrderIdstring lines[].itemIdstring lines[].descriptionstring lines[].quantitynumber lines[].quantityReceivednumber lines[].unitCostCentsinteger Integer cents. lines[].sortOrderinteger lines[].totalCentsinteger Integer cents. lines[].remainingnumber Still to receive. lines[].itemobject lines[].item.idstring lines[].item.codestring or null lines[].item.namestring lines[].item.unitstring lines[].item.vendorPartNumberstring or null receivedValueCentsinteger What has arrived so far, at the PO's unit costs.
DELETE /organizations/{organizationId}/purchase-orders/{purchaseOrderId}
Destructive: deletes an order nothing was received on (409 otherwise: cancel it). Its number is not reused.
Permission purchasing.manage (Owner, Admin)Risk sensitive, OAuth scope servflo.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.MCP tool purchaseOrders_delete (toolset pricebook)Approval Over MCP, this tool always waits for your approval in ServFlo. See Approvals .
Name In Type Required Description purchaseOrderIdpath string Yes
curl -X DELETE "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /purchase-orders/{purchaseOrderId}" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields Field Type Description oktrue
POST /organizations/{organizationId}/purchase-orders/{purchaseOrderId}/send
Marks a DRAFT order SENT and records the date (you ordered by phone, email or the printed PO). Nothing is emailed by ServFlo. Returns it.
Permission purchasing.manage (Owner, Admin)Risk write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.MCP tool purchaseOrders_send (toolset pricebook)
Name In Type Required Description purchaseOrderIdpath string Yes
curl -X POST "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /purchase-orders/{purchaseOrderId}/send" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields Field Type Description idstring organizationIdstring identifierstring PO-n vendorIdstring locationIdstring jobIdstring or null statusenum DRAFT (editable), SENT (ordered; still editable until something arrives), PARTIALLY_RECEIVED, RECEIVED, CANCELLED. One of DRAFT, SENT, PARTIALLY_RECEIVED, RECEIVED, CANCELLED. expectedDatestring or null notesstring or null subtotalCentsinteger Integer cents. totalCentsinteger Integer cents. sentAtstring (date-time) or null receivedAtstring (date-time) or null cancelledAtstring (date-time) or null createdByUserIdstring or null createdAtstring (date-time) updatedAtstring (date-time) vendorobject vendor.idstring vendor.namestring vendor.contactNamestring or null vendor.emailstring or null vendor.phonestring or null vendor.termsstring or null locationobject location.idstring location.namestring location.kindstring location.addressstring or null jobobject or null job.idstring job.identifierstring job.customerobject job.customer.idstring job.customer.namestring linesarray of object lines[].idstring lines[].purchaseOrderIdstring lines[].itemIdstring lines[].descriptionstring lines[].quantitynumber lines[].quantityReceivednumber lines[].unitCostCentsinteger Integer cents. lines[].sortOrderinteger lines[].totalCentsinteger Integer cents. lines[].remainingnumber Still to receive. lines[].itemobject lines[].item.idstring lines[].item.codestring or null lines[].item.namestring lines[].item.unitstring lines[].item.vendorPartNumberstring or null receivedValueCentsinteger What has arrived so far, at the PO's unit costs.
POST /organizations/{organizationId}/purchase-orders/{purchaseOrderId}/receive
Stock and costs: posts RECEIVE movements into the order's location for what arrived (all that is outstanding without receipts; never more than ordered, 400), updates each item's cost by moving average (MARKUP items are repriced), links the cost to the order's job, and sets PARTIALLY_RECEIVED or RECEIVED. Returns the order, what was received and the cost changes.
Permission purchasing.manage (Owner, Admin)Risk write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.MCP tool purchaseOrders_receive (toolset pricebook)
Name In Type Required Description purchaseOrderIdpath string Yes
Field Type Required Description receiptsarray of object No Per line: the quantity that arrived. Omit to receive everything outstanding. Up to 500 items. receipts[].lineIdstring Yes receipts[].quantitynumber Yes At most 1000000.
curl -X POST "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /purchase-orders/{purchaseOrderId}/receive" \
-H "Authorization: Bearer $SERVFLO_API_KEY " \
-H "Content-Type: application/json" \
-d '{"receipts":[{"lineId":"line_id","quantity":1}]}'
200: the answer's fields Field Type Description purchaseOrderobject purchaseOrder.idstring purchaseOrder.organizationIdstring purchaseOrder.identifierstring PO-n purchaseOrder.vendorIdstring purchaseOrder.locationIdstring purchaseOrder.jobIdstring or null purchaseOrder.statusenum DRAFT (editable), SENT (ordered; still editable until something arrives), PARTIALLY_RECEIVED, RECEIVED, CANCELLED. One of DRAFT, SENT, PARTIALLY_RECEIVED, RECEIVED, CANCELLED. purchaseOrder.expectedDatestring or null purchaseOrder.notesstring or null purchaseOrder.subtotalCentsinteger Integer cents. purchaseOrder.totalCentsinteger Integer cents. purchaseOrder.sentAtstring (date-time) or null purchaseOrder.receivedAtstring (date-time) or null purchaseOrder.cancelledAtstring (date-time) or null purchaseOrder.createdByUserIdstring or null purchaseOrder.createdAtstring (date-time) purchaseOrder.updatedAtstring (date-time) purchaseOrder.vendorobject purchaseOrder.vendor.idstring purchaseOrder.vendor.namestring purchaseOrder.vendor.contactNamestring or null purchaseOrder.vendor.emailstring or null purchaseOrder.vendor.phonestring or null purchaseOrder.vendor.termsstring or null purchaseOrder.locationobject purchaseOrder.location.idstring purchaseOrder.location.namestring purchaseOrder.location.kindstring purchaseOrder.location.addressstring or null purchaseOrder.jobobject or null purchaseOrder.job.idstring purchaseOrder.job.identifierstring purchaseOrder.job.customerobject purchaseOrder.linesarray of object purchaseOrder.lines[].idstring purchaseOrder.lines[].purchaseOrderIdstring purchaseOrder.lines[].itemIdstring purchaseOrder.lines[].descriptionstring purchaseOrder.lines[].quantitynumber purchaseOrder.lines[].quantityReceivednumber purchaseOrder.lines[].unitCostCentsinteger Integer cents. purchaseOrder.lines[].sortOrderinteger purchaseOrder.lines[].totalCentsinteger Integer cents. purchaseOrder.lines[].remainingnumber Still to receive. purchaseOrder.lines[].itemobject purchaseOrder.receivedValueCentsinteger What has arrived so far, at the PO's unit costs. receivedarray of object received[].lineIdstring received[].quantitynumber costChangesarray of object costChanges[].itemIdstring costChanges[].frominteger The item's unit cost before. costChanges[].tointeger Its moving-average cost now.
POST /organizations/{organizationId}/purchase-orders/{purchaseOrderId}/cancel
Cancels an open order; what was already received stays in stock. A received order cannot be cancelled (409). Returns it.
Permission purchasing.manage (Owner, Admin)Risk write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.MCP tool purchaseOrders_cancel (toolset pricebook)
Name In Type Required Description purchaseOrderIdpath string Yes
curl -X POST "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /purchase-orders/{purchaseOrderId}/cancel" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields Field Type Description idstring organizationIdstring identifierstring PO-n vendorIdstring locationIdstring jobIdstring or null statusenum DRAFT (editable), SENT (ordered; still editable until something arrives), PARTIALLY_RECEIVED, RECEIVED, CANCELLED. One of DRAFT, SENT, PARTIALLY_RECEIVED, RECEIVED, CANCELLED. expectedDatestring or null notesstring or null subtotalCentsinteger Integer cents. totalCentsinteger Integer cents. sentAtstring (date-time) or null receivedAtstring (date-time) or null cancelledAtstring (date-time) or null createdByUserIdstring or null createdAtstring (date-time) updatedAtstring (date-time) vendorobject vendor.idstring vendor.namestring vendor.contactNamestring or null vendor.emailstring or null vendor.phonestring or null vendor.termsstring or null locationobject location.idstring location.namestring location.kindstring location.addressstring or null jobobject or null job.idstring job.identifierstring job.customerobject job.customer.idstring job.customer.namestring linesarray of object lines[].idstring lines[].purchaseOrderIdstring lines[].itemIdstring lines[].descriptionstring lines[].quantitynumber lines[].quantityReceivednumber lines[].unitCostCentsinteger Integer cents. lines[].sortOrderinteger lines[].totalCentsinteger Integer cents. lines[].remainingnumber Still to receive. lines[].itemobject lines[].item.idstring lines[].item.codestring or null lines[].item.namestring lines[].item.unitstring lines[].item.vendorPartNumberstring or null receivedValueCentsinteger What has arrived so far, at the PO's unit costs.
POST /organizations/{organizationId}/purchase-orders/from-low-stock
Low stock → "Create PO": one DRAFT order per vendor for a location's items at or below their reorder point (or itemIds), each for its suggested quantity at the item's cost. Items without a vendor are listed in itemsWithoutVendor unless vendorId orders everything from one vendor. Returns the orders.
Permission purchasing.manage (Owner, Admin)Risk write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.MCP tool purchaseOrders_fromLowStock (toolset pricebook)
Field Type Required Description locationIdstring Yes vendorIdstring or null No itemIdsarray of string No Up to 500 items.
curl -X POST "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /purchase-orders/from-low-stock" \
-H "Authorization: Bearer $SERVFLO_API_KEY " \
-H "Content-Type: application/json" \
-d '{"locationId":"location_id"}'
201: the answer's fields Field Type Description purchaseOrdersarray of object purchaseOrders[].idstring purchaseOrders[].organizationIdstring purchaseOrders[].identifierstring PO-n purchaseOrders[].vendorIdstring purchaseOrders[].locationIdstring purchaseOrders[].jobIdstring or null purchaseOrders[].statusenum DRAFT (editable), SENT (ordered; still editable until something arrives), PARTIALLY_RECEIVED, RECEIVED, CANCELLED. One of DRAFT, SENT, PARTIALLY_RECEIVED, RECEIVED, CANCELLED. purchaseOrders[].expectedDatestring or null purchaseOrders[].notesstring or null purchaseOrders[].subtotalCentsinteger Integer cents. purchaseOrders[].totalCentsinteger Integer cents. purchaseOrders[].sentAtstring (date-time) or null purchaseOrders[].receivedAtstring (date-time) or null purchaseOrders[].cancelledAtstring (date-time) or null purchaseOrders[].createdByUserIdstring or null purchaseOrders[].createdAtstring (date-time) purchaseOrders[].updatedAtstring (date-time) purchaseOrders[].vendorobject purchaseOrders[].vendor.idstring purchaseOrders[].vendor.namestring purchaseOrders[].vendor.contactNamestring or null purchaseOrders[].vendor.emailstring or null purchaseOrders[].vendor.phonestring or null purchaseOrders[].vendor.termsstring or null purchaseOrders[].locationobject purchaseOrders[].location.idstring purchaseOrders[].location.namestring purchaseOrders[].location.kindstring purchaseOrders[].location.addressstring or null purchaseOrders[].jobobject or null purchaseOrders[].job.idstring purchaseOrders[].job.identifierstring purchaseOrders[].job.customerobject purchaseOrders[].linesarray of object purchaseOrders[].lines[].idstring purchaseOrders[].lines[].purchaseOrderIdstring purchaseOrders[].lines[].itemIdstring purchaseOrders[].lines[].descriptionstring purchaseOrders[].lines[].quantitynumber purchaseOrders[].lines[].quantityReceivednumber purchaseOrders[].lines[].unitCostCentsinteger Integer cents. purchaseOrders[].lines[].sortOrderinteger purchaseOrders[].lines[].totalCentsinteger Integer cents. purchaseOrders[].lines[].remainingnumber Still to receive. purchaseOrders[].lines[].itemobject purchaseOrders[].receivedValueCentsinteger What has arrived so far, at the PO's unit costs. itemsWithoutVendorarray of string