Closed gurprreetkhattra closed 3 years ago
This is most likely an issue with the API itself, as opposed to this SDK.
I suspect you're using an update method (POST call) instead of a create method (PUT) call. If this is the case our API will attempt to edit an existing Invoice before creating a new one. Please get in touch with our support team if you aren't able to resolve the issue.
- Version [xero-php-oauth2]
I submit all invoices the first time it's working fine, after delete invoices from the draft, API returns the validation error "Invoice not of valid status for modification", I'm not getting without changing the status for the invoices why this error occur. Please help me with this issue, It's urgent
Input:-
{ "Invoices": [ { "Type": "ACCREC", "Contact": { "ContactID": "1233434234234234234", "HasAttachments": false, "HasValidationErrors": false }, "LineItems": [
] }
Output:-
{ "ErrorNumber": 10, "Type": "ValidationException", "Message": "A validation exception occurred", "Elements": [ { "Type": "ACCREC", "InvoiceID": "wqewqeqewq", "Reference": "ewqewqe", "Payments": [], "CreditNotes": [], "Prepayments": [], "Overpayments": [], "IsDiscounted": false, "HasAttachments": false, "HasErrors": true, "Contact": { "ContactID": "qwqwqwqwewqewqewqewqe", "Addresses": [], "Phones": [], "ContactGroups": [], "ContactPersons": [], "HasAttachments": false, "HasValidationErrors": false, "ValidationErrors": [] }, "DateString": "2021-10-17T13:00:00", "Date": "\/Date(1634475600000+0000)\/", "DueDateString": "2021-10-24T13:00:00", "DueDate": "\/Date(1635080400000+0000)\/", "Status": "DRAFT", "LineAmountTypes": "Exclusive", "LineItems": [
{ "ItemCode": "Base Rate", "Description": "dummy text", "UnitAmount": 10, "TaxType": "EXEMPTOUTPUT", "TaxAmount": 0.00, "LineAmount": 20, "AccountCode": "0105", "Tracking": [], "Quantity": 2.0000, "AccountID": "eqwewqeqwewqe", "ValidationErrors": [] }, { "ItemCode": "Base Rate", "Description": "dummy text", "UnitAmount": 10, "TaxType": "EXEMPTOUTPUT", "TaxAmount": 0.00, "LineAmount": 30, "AccountCode": "0105", "Tracking": [], "Quantity": 3.0000, "AccountID": "qeqweqwewq", "ValidationErrors": [] } ], "SubTotal": 50, "TotalTax": 0.00, "Total": 50, "CurrencyCode": "AUD", "ValidationErrors": [ { "Message": "Invoice not of valid status for modification" } ] } ] }
Thanks