I have a JSON object that has been validated using https://jsonlint.com/. However, I am encountering an error when trying to use this JSON with the Xero API as shown below.
{
"Type": "ACCREC",
"Status": "AUTHORISED",
"DueDate": "2021-12-11T14:24:08Z",
"InvoiceNumber": "PRO152125",
"Contact": {
"ContactID": "ddd-05f9-46dd-b4a6-2ccbb5deb330"
},
"LineItems": [
"{\"Description\": \"test1\", \"Qty\": 0.30, \"UnitAmount\": 950.0, \"TaxType\": \"OUTPUT2\", \"AccountCode\": \"200\"},\n{\"Description\": \"test2\", \"Qty\": 0.30, \"UnitAmount\": 300.0, \"TaxType\": \"OUTPUT2\", \"AccountCode\": \"200\"}"
]
}
{
"ErrorNumber": 14,
"Type": "PostDataInvalidException",
"Message": "JSON for post data was invalid,Error converting value \"{\"Description\": \"test1\", \"Qty\": 0.30, \"UnitAmount\": 950.0, \"TaxType\": \"OUTPUT2\", \"AccountCode\": \"200\"},\n{\"Description\": \"test2\", \"Qty\": 0.30, \"UnitAmount\": 300.0, \"TaxType\": \"OUTPUT2\", \"AccountCode\": \"200\"}\" to type 'Xero.API.Library.DataContracts.LineItem'. Path 'LineItems[0]', line 1, position 417."
}
Could someone assist me in understanding why this issue is occurring?