Jump to content

Error when creating new sales invoice


 Share

Recommended Posts

Hi,

This is an error I haven't come across before. I am calling the /sales_invoice endpoint and providing all of the required data, plus a few extra bits of information. When I submit the request to the POST sales_invoice endpoint I get this error: 

[{'$severity': 'error', '$dataCode': 'RecordInvalid', '$message': 'This field is required.', '$source': 'line_items.currency_tax_amount'}]

I didn't this the currency_tax_amount was a required field. I haven't had this issue before and have been able to create invoices perfectly fine in the past. Any ideas on how to fix this?

Link to comment
Share on other sites

Hi Norman,

Thank you for your question. 

We're currently looking into this after it was reported 

Adding a tax_amount of 0.00 resolved the issue in this case. Could you provide us with the full body you were sending in the request please Norman.

Link to comment
Share on other sites

Hi Mark,

Here is the body of the request:

{'sales_invoice': {'contact_id': '3b0cdd0d9b954e90af637fd2d900g2y6', 'date': '2023-05-01', 'due_date': '2023-05-01', 'reference': '1234', 'invoice_lines': [{'description': 'Some Product Title', 'ledger_account_id': '1d1241a1c29b11ea8d3c022ace1a54s2', 'unit_price': 4.16, 'product_id': 'be54cd46cda24132abb4534fc1f66532', 'quantity': 3.0, 'tax_rate_id': 'GB_STANDARD', 'tax_amount': 2.49}, {'description': 'Postage', 'ledger_account_id': '1d1241a1c29b11ea8d3c022ace1a54s2', 'unit_price': 0.0, 'product_id': 'a38ef5c4751c469b8101c0c02112we34', 'quantity': 1.0, 'tax_rate_id': 'GB_STANDARD', 'tax_amount': 0.0}, {'description': 'Rounding adjustment', 'ledger_account_id': '1d1241a1c29b11ea8d3c022ace1a32ew', 'unit_price': -2.25, 'quantity': 1.0, 'tax_rate_id': 'GB_STANDARD'}], 'status_id': 'PAID'}}

I've changed some values for privacy reasons etc. This body has worked for the last year and a half for us and now it's all of a sudden throwing the said error. Thanks

Link to comment
Share on other sites

The in house software we use your API synchronises our orders from our eBay platform to Sage. We've been having this problem I would say since the start of March, but at the same time the eBay API that we use also had faults with it that caused errors in the software. So both of the APIs could have been causing faults at the same time. So it is hard to tell if the issue with the Sage API started then as well. But just to be safe I'd say the start of March. 

Cheers

Edited by Norman Firkins
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...