I’ve got BadRequest with an error “A validation exception occurred The discount rate ‘0.00’ is invalid.”, when trying to send create Invoice request via API, when invoice has line items with negative amount. At the same time, I can create Invoice with negative line items via UI. Is this possible using API at all? C
Request:
{
"AmountDue": 1.0,
"AmountPaid": 0.0,
"Contact": {
"ContactID": "080d6f7d-db12-4a35-ae52-de5a4e815b4d"
},
"CurrencyCode": "CAD",
"CurrencyRate": 0.0,
"Date": "2024-05-02T15:22:44",
"LineAmountTypes": "Exclusive",
"LineItems": [
{
"AccountCode": "200",
"Description": "item2",
"DiscountAmount": 0.0,
"DiscountRate": "0.00000",
"ItemCode": "item2",
"LineAmount": 10.0,
"Quantity": 1.0,
"TaxAmount": 0.0,
"UnitAmount": 10.0
},
{
"AccountCode": "200",
"Description": "item3",
"DiscountAmount": 0.0,
"DiscountRate": "0.00000",
"ItemCode": "item3",
"LineAmount": -9.0,
"Quantity": 1.0,
"TaxAmount": 0.0,
"UnitAmount": -9.0
}
],
"SentToContact": false,
"Status": "DRAFT",
"SubTotal": 1.0,
"Total": 1.0,
"TotalDiscount": 0.0,
"TotalTax": 0.0,
"Type": "ACCREC"
}
Expect it to work, since it is possible via UI.
New contributor
Anton Serhieiev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.