The field name
lineitems is wrong. The Vtiger CRM webservices API for inventory modules is
case-sensitive and the correct key is
LineItems — capital L, capital I.
Working payload:
json
{
"subject": "INV-2025-001",
"account_id": "3x12",
"invoicedate": "2025-06-01",
"LineItems": [
{
"productid": "14x55",
"quantity": "2",
"listprice": "150.00",
"comment": "",
"deleted": "0"
}
]
}
Other case-sensitive inventory field names to watch:
| Wrong | Correct |
|---|---|
|
lineitems |
LineItems |
|
hdnproductid |
productid |
|
productdescription |
productDescription |
Debug tip: The error message
MANDATORY_FIELDS_MISS does not tell you which field is missing. Enable PHP debug logging and look for the SQL INSERT that fails.