curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"sku": "WIDGET-001",
"quantity": 25,
"unit_price": 12.5
}
]
}
'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items"
payload = { "items": [
{
"sku": "WIDGET-001",
"quantity": 25,
"unit_price": 12.5
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({items: [{sku: 'WIDGET-001', quantity: 25, unit_price: 12.5}]})
};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'sku' => 'WIDGET-001',
'quantity' => 25,
'unit_price' => 12.5
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items"
payload := strings.NewReader("{\n \"items\": [\n {\n \"sku\": \"WIDGET-001\",\n \"quantity\": 25,\n \"unit_price\": 12.5\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"sku\": \"WIDGET-001\",\n \"quantity\": 25,\n \"unit_price\": 12.5\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"sku\": \"WIDGET-001\",\n \"quantity\": 25,\n \"unit_price\": 12.5\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"order_numbers": [
"<string>"
],
"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",
"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,
"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,
"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",
"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,
"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>"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Append line items to a purchase order
Append one or more line items to an existing active purchase order without pruning any
existing lines. This is the additive counterpart to PUT /purchase-orders/{id}, which is
replace-all (any omitted line is deleted). The appended lines go through the same builders as
POST /purchase-orders — unit-of-measure conversion, incoming-stock increment, cost recompute,
and lot / custom-field / tag handling are identical to create — and the purchase order header
totals (order_cost, order_quantity, item_count, tax/shipping) are recalculated afterward.
Only active purchase orders accept new lines; a 409 Conflict is returned for
completed / received / deleted orders.
Note: This endpoint is part of the container / Purchase-to-Order workflow and is gated by the
PURCHASE_TO_ORDERfeature flag. Contact Luminous to have it enabled for your tenant.
curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"sku": "WIDGET-001",
"quantity": 25,
"unit_price": 12.5
}
]
}
'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items"
payload = { "items": [
{
"sku": "WIDGET-001",
"quantity": 25,
"unit_price": 12.5
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({items: [{sku: 'WIDGET-001', quantity: 25, unit_price: 12.5}]})
};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'sku' => 'WIDGET-001',
'quantity' => 25,
'unit_price' => 12.5
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items"
payload := strings.NewReader("{\n \"items\": [\n {\n \"sku\": \"WIDGET-001\",\n \"quantity\": 25,\n \"unit_price\": 12.5\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"sku\": \"WIDGET-001\",\n \"quantity\": 25,\n \"unit_price\": 12.5\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"sku\": \"WIDGET-001\",\n \"quantity\": 25,\n \"unit_price\": 12.5\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"order_numbers": [
"<string>"
],
"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",
"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,
"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,
"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",
"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,
"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>"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Authenticate using a bearer token. To create a token, navigate to /settings/api-tokens and click Create API Token.
Path Parameters
ID of the purchase order to append line items to
Body
Line items to append to the purchase order
1Show child attributes
Show child attributes
Optionally set or update the purchase order's target container volume in cubic metres (the container-fill gauge's denominator) while appending line items.
x >= 067
Response
Line items appended; the updated purchase order is returned
Show child attributes
Show child attributes