curl --request PATCH \
--url https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items/{lineItemId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"quantity": 120,
"unit_price": 4.25
}
'{
"data": {
"id": 78001,
"purchase_order_id": 9001,
"product_id": 5521,
"quantity": 120,
"ordered_qty": 120,
"quantity_received": 40,
"unit_price": 4.25,
"presentment_unit_price": null,
"line_total": 510,
"payment_schedule": [
{
"id": 3301,
"milestone_label": "Deposit",
"milestone_type": "deposit",
"sequence": 1,
"status": "fulfilled",
"percentage": 30,
"amount": 150,
"paid_amount": 150,
"due_amount": 0,
"expected_amount": 153,
"over_under": -3
}
]
},
"purchase_order": {
"id": 123,
"order_numbers": [
"<string>"
],
"created_by": 12,
"created_by_name": "Pat Buyer",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"order_status": "active",
"order_date": "2023-12-25",
"invoice_date": "2023-12-25",
"arrival_due_date": "2023-12-25",
"requested_ship_date": "2023-12-25",
"original_arrival_due_date": "2023-12-25",
"shipment_type": "Air",
"override_transit_days": 123,
"order_type": 123,
"incoterm": "<string>",
"tracking_info": "<string>",
"payment_terms": "<string>",
"supplier_id": 123,
"item_count": 123,
"total_qty_ordered": 123,
"total_qty_received": 123,
"total_qty_remaining": 123,
"receipt_status": "awaiting_shipment",
"currency_code": "EUR",
"exchange_rate": 1.085,
"order_cost": 123,
"total_tax": 123,
"total_shipping_cost": 123,
"total_cost": 123,
"total_paid": 123,
"total_due": 123,
"total_volume_cbm": 123,
"total_weight_kg": 123,
"lines_missing_dimensions": 123,
"volume_target_cbm": 123,
"volume_remaining_cbm": 123,
"volume_fill_percent": 123,
"down_payment": 123,
"public_note": "<string>",
"private_note": "<string>",
"starred": true,
"items": [
{
"id": 123,
"purchase_order_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"quantity": 123,
"presentment_unit_price": 123,
"unit_price": 123,
"unit": "<string>",
"tax": 123,
"discount_amount": 123,
"line_total": 123,
"expected_ship_date": "2023-12-25",
"expected_arrival_date": "2023-12-25",
"requested_ship_date": "2023-12-25",
"arrival_due_date": "2023-12-25",
"shipment_type": "Air",
"original_arrival_due_date": "2023-12-25",
"override_transit_days": 123,
"quantity_received": 123,
"received_quantity": 123,
"quantity_ordered": 123,
"quantity_shipped": 123,
"quantity_billed": 123,
"quantity_allocated": 123,
"quantity_released": 123,
"under_covered_quantity": 123,
"remaining_to_ship": 123,
"remaining_to_receive": 123,
"open_quantity": 40,
"closed_at": null,
"close_reason": null,
"available_to_allocate": 123,
"volume_cbm": 123,
"line_volume_cbm": 123,
"weight_kg": 123,
"line_weight_kg": 123,
"allocations": [
{
"sales_order_id": 123,
"sales_order_number": "<string>",
"quantity_allocated": 123,
"quantity_released": 123,
"peg_ids": [
123
]
}
],
"source_sku": "<string>",
"product": {
"id": 123,
"name": "<string>",
"description": "<string>",
"retail_price": 123,
"wholesale_price": 123,
"unit_cost": 123,
"product_weight": 123,
"product_length": 123,
"product_width": 123,
"product_height": 123,
"sellable": true,
"discontinued": true,
"image_url": "<string>",
"variant_attributes": {},
"sku": "<string>",
"upc": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"base_unit_of_measure": {
"id": 123,
"name": "<string>",
"abbreviation": "<string>"
},
"ordered_unit_of_measure": {
"id": 123,
"name": "<string>",
"abbreviation": "<string>"
},
"lot": {
"id": 123,
"lot_number": "<string>",
"expiration_date": "2023-12-25"
}
}
],
"supplier": {
"id": 123,
"status": 123,
"name": "<string>",
"description": "<string>",
"street_address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"contact_name": "<string>",
"contact_email": "<string>",
"contact_phone": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": {
"Region": "Southwest",
"Preferred Carrier": "UPS"
}
},
"payments": [
{
"id": 123,
"payment_date": "2023-12-25",
"payment_type": "cash",
"paid_amount": 123,
"remarks": "<string>",
"external_id": "<string>",
"created_by": {
"id": 123,
"name": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"ship_to": {
"address_1": "<string>",
"address_2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"default_ship_to_address": "ship_to_address"
},
"warehouse_id": 123,
"location_id": 123,
"warehouse": {
"id": 123,
"name": "<string>"
},
"location": {
"id": 123,
"name": "<string>"
},
"tags": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"color": "<string>"
}
],
"fulfillment_orders": [
{
"id": 123,
"order_number": "<string>",
"order_status": "<string>"
}
],
"custom_fields": {}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Edit a purchase-order line's quantity or unit price
Change one purchase-order line’s quantity and/or unit_price in place. Send either field or
both. The line keeps its id, so its bill and receipt links stay attached, and the other lines
on the purchase order are left alone. By contrast, the full-replace PUT /purchase-orders/{id}
prunes any line it is not sent.
The edit goes through the same single-line save as the purchase-order grid. Incoming stock, the line total, the purchase-order totals and any unbilled receiving reports are updated, and the purchase-order-updated automations run. On a purchase order already sent to the supplier, the change is recorded as an API revision.
quantityis in the line’s ordered unit of measure. It cannot be lower than what has already been received on the line (compared in the SKU’s base unit); that returns422. Editing the quantity of a closed line also returns422.unit_priceis in the base currency. On a purchase order with acurrency_code, the line’s supplier-currency price (presentment_unit_price) is restated from it at the purchase order’s exchange rate.
The purchase order’s payment schedule is recalculated in the same step and returned as
data.payment_schedule. Milestones with nothing paid against them are re-derived from the new
purchase-order total. A milestone that is paid or partly paid keeps its amount, and the unpaid
percentage milestones absorb the difference so the schedule still adds up to the new total. If
the schedule cannot be recalculated, the request fails with 500 and the line is left unchanged.
curl --request PATCH \
--url https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items/{lineItemId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"quantity": 120,
"unit_price": 4.25
}
'{
"data": {
"id": 78001,
"purchase_order_id": 9001,
"product_id": 5521,
"quantity": 120,
"ordered_qty": 120,
"quantity_received": 40,
"unit_price": 4.25,
"presentment_unit_price": null,
"line_total": 510,
"payment_schedule": [
{
"id": 3301,
"milestone_label": "Deposit",
"milestone_type": "deposit",
"sequence": 1,
"status": "fulfilled",
"percentage": 30,
"amount": 150,
"paid_amount": 150,
"due_amount": 0,
"expected_amount": 153,
"over_under": -3
}
]
},
"purchase_order": {
"id": 123,
"order_numbers": [
"<string>"
],
"created_by": 12,
"created_by_name": "Pat Buyer",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"order_status": "active",
"order_date": "2023-12-25",
"invoice_date": "2023-12-25",
"arrival_due_date": "2023-12-25",
"requested_ship_date": "2023-12-25",
"original_arrival_due_date": "2023-12-25",
"shipment_type": "Air",
"override_transit_days": 123,
"order_type": 123,
"incoterm": "<string>",
"tracking_info": "<string>",
"payment_terms": "<string>",
"supplier_id": 123,
"item_count": 123,
"total_qty_ordered": 123,
"total_qty_received": 123,
"total_qty_remaining": 123,
"receipt_status": "awaiting_shipment",
"currency_code": "EUR",
"exchange_rate": 1.085,
"order_cost": 123,
"total_tax": 123,
"total_shipping_cost": 123,
"total_cost": 123,
"total_paid": 123,
"total_due": 123,
"total_volume_cbm": 123,
"total_weight_kg": 123,
"lines_missing_dimensions": 123,
"volume_target_cbm": 123,
"volume_remaining_cbm": 123,
"volume_fill_percent": 123,
"down_payment": 123,
"public_note": "<string>",
"private_note": "<string>",
"starred": true,
"items": [
{
"id": 123,
"purchase_order_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"quantity": 123,
"presentment_unit_price": 123,
"unit_price": 123,
"unit": "<string>",
"tax": 123,
"discount_amount": 123,
"line_total": 123,
"expected_ship_date": "2023-12-25",
"expected_arrival_date": "2023-12-25",
"requested_ship_date": "2023-12-25",
"arrival_due_date": "2023-12-25",
"shipment_type": "Air",
"original_arrival_due_date": "2023-12-25",
"override_transit_days": 123,
"quantity_received": 123,
"received_quantity": 123,
"quantity_ordered": 123,
"quantity_shipped": 123,
"quantity_billed": 123,
"quantity_allocated": 123,
"quantity_released": 123,
"under_covered_quantity": 123,
"remaining_to_ship": 123,
"remaining_to_receive": 123,
"open_quantity": 40,
"closed_at": null,
"close_reason": null,
"available_to_allocate": 123,
"volume_cbm": 123,
"line_volume_cbm": 123,
"weight_kg": 123,
"line_weight_kg": 123,
"allocations": [
{
"sales_order_id": 123,
"sales_order_number": "<string>",
"quantity_allocated": 123,
"quantity_released": 123,
"peg_ids": [
123
]
}
],
"source_sku": "<string>",
"product": {
"id": 123,
"name": "<string>",
"description": "<string>",
"retail_price": 123,
"wholesale_price": 123,
"unit_cost": 123,
"product_weight": 123,
"product_length": 123,
"product_width": 123,
"product_height": 123,
"sellable": true,
"discontinued": true,
"image_url": "<string>",
"variant_attributes": {},
"sku": "<string>",
"upc": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"base_unit_of_measure": {
"id": 123,
"name": "<string>",
"abbreviation": "<string>"
},
"ordered_unit_of_measure": {
"id": 123,
"name": "<string>",
"abbreviation": "<string>"
},
"lot": {
"id": 123,
"lot_number": "<string>",
"expiration_date": "2023-12-25"
}
}
],
"supplier": {
"id": 123,
"status": 123,
"name": "<string>",
"description": "<string>",
"street_address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"contact_name": "<string>",
"contact_email": "<string>",
"contact_phone": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": {
"Region": "Southwest",
"Preferred Carrier": "UPS"
}
},
"payments": [
{
"id": 123,
"payment_date": "2023-12-25",
"payment_type": "cash",
"paid_amount": 123,
"remarks": "<string>",
"external_id": "<string>",
"created_by": {
"id": 123,
"name": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"ship_to": {
"address_1": "<string>",
"address_2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"default_ship_to_address": "ship_to_address"
},
"warehouse_id": 123,
"location_id": 123,
"warehouse": {
"id": 123,
"name": "<string>"
},
"location": {
"id": 123,
"name": "<string>"
},
"tags": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"color": "<string>"
}
],
"fulfillment_orders": [
{
"id": 123,
"order_number": "<string>",
"order_status": "<string>"
}
],
"custom_fields": {}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Path Parameters
Body
At least one of quantity or unit_price is required.
Response
Line updated. data is the edited line; purchase_order is the whole purchase order after
the edit (same shape as GET /purchase-orders/{id}), so its new totals can be read without
a second request.