Jump to content

500 internal server error when trying to create a sales invoice.


 Share

Recommended Posts

I am getting an unexpected error when trying to create a sales invoice.  This was previously working without issue.  

This is what it being sent simplified with minimal required fields according to the docs.   But this returns an error "Server error: `POST https://api.accounting.sage.com/v3.1/sales_invoices` resulted in a `500 Internal Server Error` response:\n[{\"$severity\":\"error\",\"$dataCode\":\"UnexpectedError\",\"$message\":\"An unexpected error occurred.\",\"$source\":\"\"}]\n:

{
  "sales_invoice": {
    "contact_id": "fd0a8d1f0f034641878483b4ac12d87d",
    "date": "2023-04-17",
    "invoice_lines": [
      {
        "description": "multi batcher",
        "ledger_account_id": "4195173e75db11e8990a122c8428e4b2",
        "quantity": 1,
        "unit_price": "12.00",
        "tax_rate_id": "8a34353c815241c38001ff3a0ea55b7c"
      },
      {
        "description": "Flower 1",
        "ledger_account_id": "4195173e75db11e8990a122c8428e4b2",
        "quantity": 1,
        "unit_price": "12.00",
        "tax_rate_id": "8a34353c815241c38001ff3a0ea55b7c"
      },
      {
        "description": "multi batcher",
        "ledger_account_id": "4195173e75db11e8990a122c8428e4b2",
        "quantity": 1,
        "unit_price": "12.00",
        "tax_rate_id": "8a34353c815241c38001ff3a0ea55b7c"
      }
    ]
  }
}

 

Link to comment
Share on other sites

Hi Joshua,

Thank you for your question.

Can you confirm the following please:

  • The location of the business you are attempting to create the invoice for
  • The location inc state/province if in NA of the selected customer
  • How you are obtaining the tax_rate_id

Thanks

Mark

Link to comment
Share on other sites

Hello Mark,

 

Thank you for getting back to me. 

The location of the business is Oregon, United States.

The Location of the customer is Oregon, United States.

I am getting the tax_rate_id through the contact endpoint for the contact being invoiced.  I am using the "default_sales_tax_rate" id.  

Link to comment
Share on other sites

Hey there,

Can confirm this is an issue for me as well. It was working in production on the the 26th of April, and this error has been popping up since the 27th. I have a CA_NO_TAX tax_rate_id with a specified tax_amount of 0  (due to a breaking change that was randomly pushed at the end of march that forced this tax rate to specify a tax amount of 0). This issue is occurring with all sales_invoices that I try to create for multiple different customers, to no avail.

Wierdly enough, trying the exact same request in my test environment, and therefore with different ledger accounts and contacts, is successful.

I am therefore assuming this is related to ledger accounts and not contacts.

I will investigate further to see if I can somehow replicate the issue in my test environment.

Link to comment
Share on other sites

2 hours ago, Steel, Mark said:

Thank you all for your input.

We've located examples in our logs and are currently investigating the cause.

We'll let you know as soon as we discover the cause.

Thanks

Mark

I have not been able to replicate on my end in my test environment, so it might be related to settings or something else.

Please keep us updated on the issue!

 

Thanks!

P.S. Are there any news about developer trial versions for Sage? Making multiple email aliases and getting all data reset every 30 days is very counter-productive.

Link to comment
Share on other sites

Hello Mark,

Is there any update on this issue.   I'm still experiencing this issue.  

Here is some examples bodies that fail. 

{
  "sales_invoice": {
    "contact_id": "a6c6d3b4cce8422d910b7405e97c2848",
    "date": "2023-05-08",
    "invoice_lines": [
      {
        "description": "bla bla",
        "ledger_account_id": "237af38ece4811eda8c40ef4cf562701",
        "quantity": 1,
        "unit_price": "12.00",
        "tax_amount": "0.0",
        "tax_rate_id": "8a34353c815241c38001ff3a0ea55b7c"
      }
    ]
  }
}

The tax rate id is no tax.

The ledger id is sale of materials.

------------------------------------------------------------------------------

Second Example.

{
  "sales_invoice": {
    "contact_id": "a6c6d3b4cce8422d910b7405e97c2848",
    "date": "2023-05-08",
    "invoice_lines": [
      {
        "description": "bla bla",
        "ledger_account_id": "237af38ece4811eda8c40ef4cf562701",
        "quantity": 1,
        "unit_price": "12.00",
        "tax_amount": "0.0"
      }
    ]
  }
}

The tax rate id is no tax.

The ledger id is sale of materials.

-----------------------------------------------------------------------------

No matter what I have been getting this 500 error back.  As stated previously this worked with no issue before.  If I am unable to get this resolved.  We will need our clients to use different software for accounting.  This is urgently needing fixed.  

[{"$severity":"error","$dataCode":"UnexpectedError","$message":"An unexpected error occurred.","$source":""}]
Link to comment
Share on other sites

38 minutes ago, Joshua Getner said:

No matter what I have been getting this 500 error back.  As stated previously this worked with no issue before.  If I am unable to get this resolved.  We will need our clients to use different software for accounting.  This is urgently needing fixed.  

[{"$severity":"error","$dataCode":"UnexpectedError","$message":"An unexpected error occurred.","$source":""}]

I've never managed to replicate this issue on fresh test accounts, even with the same ledger account data. I have only been able to replicate this on the production account.

I agree with the urgency of the situation: with all due respect, an accounting software that doesn't have a working invoicing solution is simply unusable. Please escalate this bug.

Link to comment
Share on other sites

Thank you Mark!

Invoices are working!  In my testing to ensure it was working.  I encountered an error item.description is required.  The description is there but i think its hitting a character limit.  Is there a character limit on item.description and if so what is that limit?  

Link to comment
Share on other sites

Thanks for the confirmation Joshua.

There's no character limit for the invoice_lines description field or at least not within reason. I posted an invoice with a description of 1000 chars without issue.

If you can provide an example body of what you're attempting to post we can take a look at where it might be going wrong for you.

Thanks

Mark

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...