curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/transaction-cogs/update-costs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "sales_item_ids",
"sales_item_ids": [
101,
102,
103
],
"cost_per_unit": 12.5
}
'
{
"updated_count": 47
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Reports
Update per-line COGS from unit cost
Applies cost_per_unit to matching sales lines: sets line total cost (quantity × unit cost), updates linked
sales item cost layers, and rolls up parent order item costs. This is the same behavior as the admin
Transaction COGS SKU-to-period import.
Exactly one of three modes is selected via mode:
Mode: sales_item_ids
Directly target specific sales item IDs with a given cost per unit.
Mode: sku_date_range
Matches lines with the product SKU whose parent order ship date falls within
from_date–to_date (inclusive).
Mode: order_ids
Targets specific internal sales order IDs. Optional sku limits to that product on those orders.
POST
/
transaction-cogs
/
update-costs
curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/transaction-cogs/update-costs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "sales_item_ids",
"sales_item_ids": [
101,
102,
103
],
"cost_per_unit": 12.5
}
'
{
"updated_count": 47
}{
"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.
Body
application/json
Response
Number of sales lines updated
Number of sales lines that were updated
Required range:
x >= 0