logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Fulcrum Developer  
#1 Posted : Tuesday, October 22, 2024 2:52:10 PM(UTC)
Fulcrum Developer

Rank: Member

Groups: Registered
Joined: 8/29/2024(UTC)
Posts: 14
United States

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

tony  
#2 Posted : Tuesday, October 22, 2024 3:06:49 PM(UTC)
tony

Rank: Advanced Member

Groups: Registered
Joined: 2/28/2018(UTC)
Posts: 65
United States
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.
Fulcrum Developer  
#3 Posted : Tuesday, October 22, 2024 3:17:10 PM(UTC)
Fulcrum Developer

Rank: Member

Groups: Registered
Joined: 8/29/2024(UTC)
Posts: 14
United States

Thanks: 3 times
That fixed it! Thanks so much.
Users browsing this topic
Guest
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.