Rank: Member
Groups: Registered
Joined: 8/29/2024(UTC) Posts: 14 Thanks: 3 times
|
Hi,
When I try to post the following payload to the A/R invoice create endpoint I receive a Database Error I haven't seen before:
{ "companyId": 2147470000, "customerId": 2147469955, "date": "2024-09-10T18:58:31.627Z", "invoiceNumber": "TEST_INVOICE", "poReference": "", "termsId": 2147470000, "freight": 0, "miscellaneous": 0, "dueDate": "2024-09-10T19:58:31.459Z", "lines": [ { "salesItemId": 2147469970, "description": "Description", "quantity": 3, "unitPrice": 650, "amount": 650 } ] }
This is the Database error:
{ "message": "Invalid Request", "errors": [ { "key": "DatabaseError", "message": "You must have an Accounts Receviable account selected before you can continue. Click on the accounts button at the bottom to fill this in." } ] }
The confusing part of this is that I have used that same payload in the past for testing purposes and I was able to successfully create an invoice.
When I try to create a similar invoice from the "Customer Invoices" page, I get the same message. I have to click the "Accounts" button and set an Accounts Receivable. But after that, I no longer get the issues via the UI but I still get it from the API.
I know I must have changed something in my CenterPoint settings for this to have started happening. But I can't figure out the issue. Please let me know what I can do to fix this.
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 2/28/2018(UTC) Posts: 65 Location: Pennsylvani mostly Was thanked: 9 time(s) in 9 post(s)
|
The A/R account it is complaining about is stored in CenterPoint Preferences. I'd open the database you are posting to in CenterPoint and go to File->Preferences, then in the Customer Invoices section there is a Defaults section that contains several A/R settings, including the Accounts Receivable account.
I believe this Preference is set on the Database level so you could have a situation where it's working in the UI for one database, but you are testing the REST API with a different database (one that doesn't have this preference set.) Hopefully that is it because I'm not sure what else it could be.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/29/2024(UTC) Posts: 14 Thanks: 3 times
|
That fixed it! Thanks so much.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Red Wing Software Developer Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close