PurchaseOrders

Adds a line to a purchase order.

Requires ManagePurchaseOrders and an Idempotency-Key header. Allowed until the order is fully received or cancelled (the app allows the same). Example: POST /api/v1/purchase-orders/412/lines { "itemId": 12, "quantityOrdered": 6 }.

post/api/v1/purchase-orders/{id}/lines

Request

  • Base URL: https://app.flexonthejob.com
  • URL: https://app.flexonthejob.com/api/v1/purchase-orders/{id}/lines
  • Auth: HTTP bearer

Path parameters

idinteger required

Purchase-order id. Example: 412.

Request body

itemIdinteger nullable

Item to order (from GET /api/v1/items); not a draft or a sub-unit item. Example: 12.

bundleTemplateIdinteger nullable

Bundle template to order instead of an item; receiving creates one bundle per unit.

descriptionstring nullable

Line text, up to 500 characters. Defaults to the item or bundle name.

vendorPartNumberstring nullable

The vendor's part number, up to 100 characters. Example: RMX-122-250.

quantityOrderedinteger

Whole units ordered, at least 1. Example: 24.

unitPricenumber double nullable

Price per unit in the order's currency; becomes each received unit's Cost. Optional, not negative. Example: 3.10.

notesstring nullable

Free-text note on the line.

Response

The purchase order with the new line.

idinteger

Numeric id used in /api/v1/purchase-orders/{id}. Unique within this organization. Example: 412.

syncIdstring uuid

Stable cross-device identifier (GUID) — also the pagination cursor value. Example: 3c9d1a2b-7e4f-4b6a-8c1d-5e6f7a8b9c0d.

orderNumberstring

The organization's purchase-order number. Example: PO-ACME-20260915-01.

externalOrderNumberstring nullable

The vendor's own order or confirmation number; null when not recorded. Example: SO-88213.

statusstring

Order status name, derived by the app from the order's shipments and received quantities. One of Draft (no shipment yet), Ordered, Shipped, PartialShipped, Delivered (at the receiving location, nothing received yet), PartialReceived, Received (every unit received and every shipment delivered), Cancelled.

vendorIdinteger nullable

Id of the vendor record; null for a one-off vendor typed on the order.

vendorNamestring nullable

Vendor name (the vendor record's name, else the one-off name on the order). Example: Acme Supply. Null when neither is set.

orderDatestring date-time

Order date as entered in the app: the organization's local calendar date, yyyy-MM-ddT00:00:00 with no UTC offset (the date-time format here is a local date, not an RFC 3339 instant; do not convert it between time zones). Example: 2026-09-15T00:00:00.

expectedDeliveryDatestring date-time nullable

Expected delivery date as entered in the app, same local calendar-date format as orderDate (no UTC offset). Example: 2026-09-22T00:00:00. Null when unknown.

receivedDatestring date-time nullable

When the order became fully Received, ISO-8601 UTC; null until then.

totalCostnumber double nullable

Order total in currency as recorded on the order; null when not calculated. Example: 1249.50.

currencystring

ISO-4217 currency code of the prices on the order. Example: USD.

receivingLocationIdinteger

Id of the location stock is received at by default (see /api/v1/locations). Example: 10.

receivingLocationNamestring nullable

Name of receivingLocationId. Example: Main Warehouse.

lineCountinteger

Number of lines on the order. Example: 3.

quantityOrderedinteger

Units ordered across all lines. Example: 40.

quantityReceivedinteger

Units received across all lines. Example: 25.

createdAtstring date-time

Creation time, ISO-8601 UTC. Example: 2026-09-15T14:05:00Z.

updatedAtstring date-time nullable

Last modification time (including a receipt), ISO-8601 UTC; null when never modified since creation.

notesstring nullable

Free-text notes on the order. Example: Deliver to dock 3. Null when none.

Changes

No recorded changes to this operation across all 1 revision of this API.