-
Notifications
You must be signed in to change notification settings - Fork 91
Description
SDK you're using (please complete the following information):
- I'm not using an SDK, I'm using RestSharp to this URL - https://api.xero.com/api.xro/2.0/Invoices
Describe the bug
I'm unable to create a new invoice when I pass what I believe to be valid JSON to the Invoices API. I receive the message "Invoice Type must be specified" even though I pass a valid invoice type of "ACCREC". The full JSON I'm sending is:
{
"Type": "ACCREC",
"Contact": {
"ContactID": "4a741842-6ffa-41af-848d-b988d8939a0a"
},
"DueDate": "\/Date(1769040000000+0000)\/",
"LineItems": [
{
"Description": "Website Other",
"Quantity": "1",
"UnitAmount": "195.00",
"AccountCode": "211"
}
],
"Status": "AUTHORISED"
}
And I'm receiving this in return:
{
"Id": "48aed37d-3f5f-4e79-8eec-c1aa3adc6802",
"Status": "OK",
"ProviderName": "CMSinvoicesCustom2",
"DateTimeUTC": "/Date(1767868604980)/",
"Invoices": [
{
"InvoiceID": "00000000-0000-0000-0000-000000000000",
"Payments": [],
"CreditNotes": [],
"Prepayments": [],
"Overpayments": [],
"IsDiscounted": false,
"InvoiceAddresses": [],
"HasErrors": true,
"InvoicePaymentServices": [],
"Status": "DRAFT",
"LineItems": [],
"StatusAttributeString": "ERROR",
"ValidationErrors": [
{
"Message": "Invoice Type must be specified"
}
]
}
]
}
To Reproduce
Steps to reproduce the behavior:
- Use the above JSON and send a Rest POST request to https://api.xero.com/api.xro/2.0/Invoices?summarizeErrors=false
- Check the response.Content
Expected behavior
I'd expect an invoice to be created for that customer
Screenshots
Here's my JSON (on the left) compared with an example of the minimum JSON necessary to create an in voice (on the right) that I obtained from the Xero API website which leads me to believe that I'm sending the correct payload to the API

Additional context
Add any other context about the problem here.