Page 1 of 1

StockTransfer REST API

PostPosted: Mon May 28, 2018 6:35 pm
by minhhieu106
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

Re: StockTransfer REST API

PostPosted: Thu May 31, 2018 8:07 am
by SBarnes
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.

Re: StockTransfer REST API

PostPosted: Thu May 31, 2018 10:44 am
by Scott.Pearce
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.

Re: StockTransfer REST API

PostPosted: Thu May 31, 2018 1:41 pm
by minhhieu106
Hi Scott,

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

How do we update Stocktransfer status?

Thanks,

Re: StockTransfer REST API

PostPosted: Thu May 31, 2018 2:07 pm
by Scott.Pearce
By setting the Status to be "Activated".

Re: StockTransfer REST API  Topic is solved

PostPosted: Thu May 31, 2018 9:48 pm
by Mike.Sheen
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.

Re: StockTransfer REST API

PostPosted: Fri Jun 01, 2018 12:45 am
by minhhieu106
Thank you Mike!