Rank: Member
Groups: Registered
Joined: 3/21/2024(UTC) Posts: 11 
|
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" } ] }
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 2/28/2018(UTC) Posts: 79  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.)
|
|
|
|
Rank: Member
Groups: Registered
Joined: 3/21/2024(UTC) Posts: 11 
|
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?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 2/28/2018(UTC) Posts: 79  Location: Pennsylvani mostly Was thanked: 9 time(s) in 9 post(s)
|
Yes, the template item provides a starting point only.
|
|
|
|
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