Create Sales Order Line
Beta/v1/sales/sales-orders/{id}/linesIdempotent with Idempotency-Key header. Learn more
Adds a line item to a sales order.
The new line is appended below the existing product lines, keeping the order's freight and discount lines at the bottom. When the order has already been issued, the line is added to its pick as outstanding work and the pick is reopened if it had been finished.
idstringSales order ID.
include[]optional arrayenumValues:productquantity_orderedunit_priceSub-objects to expand in the response. When omitted, sub-objects are returned as null.
product_idstringID of the product being ordered.
product_skustringThe product SKU recorded on the line.
product_descriptionoptional stringThe product description recorded on the line.
quantityobjectQuantity ordered.
The unit must belong to the product's unit group.
valuestring (decimal)Decimal value, as a string to preserve precision.
unit_idstringID of the unit of measure for the value.
unit_priceoptional objectUnit price override.
When omitted, the line is priced server-side from the product's pricing rules (customer price, unit-conversion and volume discounts, account-price overrides) — the same pricing applied when the order is created. An explicit value is honored only for internal users. The unit cost is always resolved from the product and never taken from the request.
valuestring (decimal)Decimal value of the rate, expressed as the amount of the numerator unit per one denominator unit.
numerator_unit_idstringID of the unit for the rate's numerator (e.g. the currency of a price).
denominator_unit_idstringID of the unit for the rate's denominator (the per-unit basis).
idstringSales order line ID.
objectstringenumValues:sales_order_lineResource type identifier.
line_item_numberintegerPosition of the line on the order.
Assigned automatically in sequence, starting at 1. Product lines are numbered first and the automatically generated freight and discount lines always sit at the bottom; removing a line renumbers the rest so the sequence stays contiguous.
product_skustringSKU recorded on this line.
Taken from the product unless the line supplies its own, and editable afterwards, so it preserves what was sold even if the product's SKU later changes.
product_descriptionstringnullableDescription recorded on this line, taken from the product unless the line supplies its own.
The item this line sells, identified by the SKU recorded when the line was created.
The product being sold on this line.
The product's type tells you what kind of line this is: the freight and discount lines an order generates for itself reference the account's built-in shipping and credit products, so their type is shipping or credit rather than sale.
idstringProduct ID.
objectstringenumValues:productResource type identifier.
typestringenumValues:saleserviceshippingProduct type code, which determines how the product behaves on orders and invoices.
sale: a standard sellable product.service: a non-physical service line, such as labor or installation.shipping: a shipping charge applied to an order.credit: a credit applied against an order or invoice.return: a returned product (RMA).tax: a tax line.
portal_visibilitystringenumValues:visiblehiddenWhether the product is shown to buyers in the customer portal.
visible: buyers can see and order the product in the portal.hidden: the product is concealed from the portal but remains usable internally.
Visibility alone is not enough to expose a product: a buyer only sees it if their account has also been granted access to the product's product line.
The product line this product is assigned to, if any.
Customer accounts are granted access to whole product lines, so this assignment is what decides which buyers can see and order the product. A product with no product line is never visible in the customer portal. The line also supplies the default commission and freight policies for the product.
null in this endpoint.The inventory item backing this product, which holds its SKU, description, pricing, and attributes.
null in this endpoint.created_atstring (date-time)Creation timestamp.
updated_atstring (date-time)Last updated timestamp.
quantity_orderedquantityExpandablenullableQuantity ordered.
idstringQuantity ID.
objectstringenumValues:quantityResource type identifier.
valuestring (decimal)Raw decimal value of the quantity, as a string to preserve precision.
This is the unformatted machine value; see display_value for the human-readable rendering with unit and thousands separators.
display_valuestringFormatted value with unit abbreviation (e.g. "$1,234.56" or "100 kg").
Unit of measure for this value (e.g. a currency, mass, or count unit).
null in this endpoint.unit_pricerateExpandablenullablePrice charged per unit.
idstringRate ID.
objectstringenumValues:rateResource type identifier.
valuestring (decimal)Decimal value of the rate, as a string to preserve precision.
Expressed as the amount of the numerator unit per one denominator unit.
Unit of the rate's numerator (e.g. the currency of a price).
null in this endpoint.Unit of the rate's denominator (the per-unit basis, e.g. kilograms for a price per kilogram).
null in this endpoint.display_valuestringHuman-readable formatted value (e.g. "$25.50 / kg" or "100 kg / hr").
created_atstring (date-time)Creation timestamp.
updated_atstring (date-time)Last updated timestamp.
unit_costrateExpandablenullableInternal cost per unit.
Reflects what the business pays for the item, not what the customer is charged, and is used to derive line profitability.
idstringRate ID.
objectstringenumValues:rateResource type identifier.
valuestring (decimal)Decimal value of the rate, as a string to preserve precision.
Expressed as the amount of the numerator unit per one denominator unit.
Unit of the rate's numerator (e.g. the currency of a price).
null in this endpoint.Unit of the rate's denominator (the per-unit basis, e.g. kilograms for a price per kilogram).
null in this endpoint.display_valuestringHuman-readable formatted value (e.g. "$25.50 / kg" or "100 kg / hr").
created_atstring (date-time)Creation timestamp.
updated_atstring (date-time)Last updated timestamp.
totalssales_order_totalsExpandablenullableDerived monetary totals for this line.
objectstringenumValues:sales_order_totalsResource type identifier.
orderedstring (decimal)Total ordered amount as a decimal string (unit price x quantity ordered).
This is the baseline the stage completions are measured against.
pickedsales_order_stage_totalPicked amount and completion.
null in this endpoint.packedsales_order_stage_totalPacked amount and completion.
null in this endpoint.invoicedsales_order_stage_totalInvoiced amount and completion.
null in this endpoint.created_atstring (date-time)Creation timestamp.
updated_atstring (date-time)Last updated timestamp.
Responses
Successful response for Create Sales Order Line