StockTransfer REST API  Topic is solved

Discussions relating to the REST API of Jiwa 7.

StockTransfer REST API

Postby minhhieu106 » Mon May 28, 2018 6:35 pm

Hi Mike,

I try to POST /StockTransfers with below JSON:

Code: Select all

   "TransferNo":"GI001",
   "TransferDate":"2018-05-19T00:00:00",
   "Reference":"GI001",
   "PhysicalWarehouseID":"00000000IB0000000003",
   "StockTransferReasonIsDefault":true,
   "LastSavedDateTime":"2018-05-28T14:23:59.4607569+07:00",
   "CreatedDateTime":"2018-05-28T14:23:59.4607569+07:00",
   "Lines":[ 
      { 
         "ItemNo":0,
         "Reference":10000000000000002,
         "TransferQuantity":11,
         "FromInventoryRecID":"000000000E00000000NP",
         "FromInventoryPartNo":"01140008",
         "LastSavedDateTime":"2018-05-28T14:23:59.4607569+07:00",
         "CreatedDateTime":"2018-05-28T14:23:59.4607569+07:00",
         "ToPartExpiryDate":"2018-05-28T14:23:59.4607569+07:00"
      }
   ],
   "Status":"Activated"
}


It always return "General Ledger Account Not Found". Please advise.

Thanks,
Hieu
minhhieu106
Occasional Contributor
Occasional Contributor
 
Posts: 49
Joined: Thu Mar 29, 2018 3:29 pm
Topics Solved: 0

Re: StockTransfer REST API

Postby SBarnes » Thu May 31, 2018 8:07 am

I would suspect this has to do with the configuration of Jiwa itself where possibly one of the accounts on the inventory classification or the ledger accounts on that inventory item itself are not set up.

Try doing the same stock transfer within Jiwa itself in the user interface and see if it produces the same error, if won't work in Jiwa itself then resolve that issue and then the API should work.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: StockTransfer REST API

Postby Scott.Pearce » Thu May 31, 2018 10:44 am

SBarnes wrote:Try doing the same stock transfer within Jiwa itself in the user interface and see if it produces the same error

+1

I just used your JSON on a fresh 7.1 demo database and got this response:

"Insufficient stock exists on a single SOH record to satisfy the quantity of 11 required for part 01140008"

Which is the correct response for the API to make in this case. I'm not sure what state your data is in, but it sound like something is mis-configured - try again with a fresh demo database and see what happens.

EDIT: FYI I used Postman (https://www.getpostman.com/) for testing this.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: StockTransfer REST API

Postby minhhieu106 » Thu May 31, 2018 1:41 pm

Hi Scott,

I just removed "Status":"Activated". It work fine.

How do we update Stocktransfer status?

Thanks,
minhhieu106
Occasional Contributor
Occasional Contributor
 
Posts: 49
Joined: Thu Mar 29, 2018 3:29 pm
Topics Solved: 0

Re: StockTransfer REST API

Postby Scott.Pearce » Thu May 31, 2018 2:07 pm

By setting the Status to be "Activated".
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: StockTransfer REST API  Topic is solved

Postby Mike.Sheen » Thu May 31, 2018 9:48 pm

minhhieu106 wrote:I just removed "Status":"Activated". It work fine.


You've not solved your original issue, but just worked around it by not activating the Stock Transfer. As Scott mentioned, the inclusion of "Status":"Activated in your DTO is the method to activate the Stock Transfer.

When you activate a Stock Transfer, there are General Ledger accounts which need to have been correctly associated with things like the Inventory Value account of the product, the Write On / Write Off accounts of the product and/or reason code. In our demo data, these are properly configured.

If "General Ledger Account Not Found" is the only information returned by the API, we should improve the return message the API gives to be more meaningful so you know which aspect of configuration is the problem - but as suggested by others try first performing the activation of the Stock Transfer within the Jiwa application itself - it may give a better indication of where the problem is.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: StockTransfer REST API

Postby minhhieu106 » Fri Jun 01, 2018 12:45 am

Thank you Mike!
minhhieu106
Occasional Contributor
Occasional Contributor
 
Posts: 49
Joined: Thu Mar 29, 2018 3:29 pm
Topics Solved: 0


Return to REST API

Who is online

Users browsing this forum: No registered users and 1 guest