Add order item
add_order_itemAdd a line item to an existing order by its externalId. Recomputes the order total. Only allowed while the order is pending or confirmed; on any other status (processing and later, cancelled, refunded) it fails with 409 CONFLICT "Order lines can only be changed while the order is pending or confirmed". Use list_orders or create_order for the order externalId, and search_products to quote a real product. The CRM recalculates shipping eligibility from the saved priced lines; a separate whole-order discount may require source-confirmed amount correction. The result echoes the operating workspace.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"productName": "<productName>",
"quantity": "<quantity>",
"unitPrice": "<unitPrice>",
"externalId": "<externalId>"
},
"name": "add_order_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sku | No | Product SKU snapshot (from search_products). Optional. | |
| discount | No | Percentage discount on this line (0-100). Default 0. | |
| quantity | Yes | Quantity ordered (integer, at least 1). | |
| unitPrice | Yes | Price per unit in the order currency, as a decimal (e.g. 199.99). Snapshotted onto the line. | |
| externalId | Yes | The order externalId returned by list_orders or create_order. | |
| productName | Yes | Line item name, snapshotted onto the order. Use search_products to quote a real catalog product's name. Required. |