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

Notification

Icon
Error

Options
Go to last post Go to first unread
ksturm@easy-automation.com  
#1 Posted : Monday, July 28, 2025 8:30:32 PM(UTC)
ksturm@easy-automation.com

Rank: Member

Groups: Registered
Joined: 3/21/2024(UTC)
Posts: 11
United States

When I POST a SalesItem it fails because returnsAndAllowancesAccountId is not specified, despite it being specified in the request. I have done this through the application we're developing and through the Swagger UI that's available with the REST service. We have tried different forms of capitalization and cannot seem to get it to work.

Below is my account request to get an account id that I then supply in the POST SalesItem request and ultimately get a failure response (all seen below).

I am running CenterPoint Accounting 19.9.30.


ACCT GET REQUEST:
curl -X 'GET' \
'http://localhost:54459/api/centerpoint/accounts?number=403000' \
-H 'accept: text/plain' \
-H 'Database: NutritionServices'


ACCT RESPONSE:
[
{
"id": 2147469967,
"abbreviation": "",
"name": "Returns & Allowances",
"number": "403000",
"type": "Revenue",
"category": "Sales Revenue"
}
]


SALESITEM POST REQUEST
curl -X 'POST' \
'http://localhost:54459/api/centerpoint/salesItems' \
-H 'accept: text/plain' \
-H 'Database: NutritionServices' \
-H 'Content-Type: application/json' \
-d '{
"abbreviation": "774",
"name": "AUREO 100",
"active": true,
"expenseAccountId": 2147469993,
"additionalDescription": "AUREO 100",
"salesAccountId": 2147469965,
"salesCategoryId": 2147469999,
"returnsAndAllowancesAccountId": 2147469967
}'


SALESITEM POST RESPONSE:
{
"message": "Invalid Request",
"errors": [
{
"key": "SalesItemModel.ReturnsAndAllowancesAccountId",
"message": "You must have a returns & allowances account before you can continue"
}
]
}
tony  
#2 Posted : Tuesday, July 29, 2025 12:47:39 PM(UTC)
tony

Rank: Advanced Member

Groups: Registered
Joined: 2/28/2018(UTC)
Posts: 79
United States
Location: Pennsylvani mostly

Was thanked: 9 time(s) in 9 post(s)
Ah, sorry.

Set the templateId to an existing inventory item's ID which ensures that all the required information is set. Some people create items in CenterPoint for this purpose because it greatly speeds up the process of manually adding an item. If you have a mix of non-tracked/service and tracked items, then you need a different templateId for each.

The goal was something very simple, but the simplicity requires a templateId (which should be marked as required but is not.)



ksturm@easy-automation.com  
#3 Posted : Tuesday, July 29, 2025 1:18:10 PM(UTC)
ksturm@easy-automation.com

Rank: Member

Groups: Registered
Joined: 3/21/2024(UTC)
Posts: 11
United States

Thank, Tony. We will try using the templateId property instead of explicitly setting each of those account and category properties. For our application that should work just fine.

I'm guessing if we did specify those properties that it would use our specified values instead of the template's values for those properties?
tony  
#4 Posted : Tuesday, July 29, 2025 3:59:01 PM(UTC)
tony

Rank: Advanced Member

Groups: Registered
Joined: 2/28/2018(UTC)
Posts: 79
United States
Location: Pennsylvani mostly

Was thanked: 9 time(s) in 9 post(s)
Yes, the template item provides a starting point only.
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.