🔌 API ✓ Solved

MANDATORY_FIELDS_MISS creating Invoice via Vtiger CRM webservices — LineItems capitalisation bug

👤 koicodedev
Q
Question
I am trying to create an Invoice via the Vtiger CRM Webservices API. I keep getting MANDATORY_FIELDS_MISS even though I am sending all the fields that the UI shows as required. My payload includes lineitems. Vtiger 8.3.0.
A
Community Solution
✓ Answered
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.
← Back to API Join to answer →