I am trying to add line items to an existing order via the API. I am able to create orders with line items via the API, but I have found that if the number of line items is too high, the process times-out/fails.
So I am attempting to create the order header, then loop through the line items and add them in batches of a certain # of lines (TBD, possibly 100). My script is creating the order header no problem, but I can’t get it to add any line items.
This is the error msg:
Specified argument was out of the range of valid values.\r\nParameter name: Invalid uri structure
This is the URL: https://xyz.com/entity/Default/22.200.001/SalesOrder/1712261/Details
I then modified the URL to be:
I do not get an error with this 2nd URL, but it just hangs. My script hangs and I do not see activity in Acumatica. This is the request payload:
{"OrderNbr": {"value": "1712277"}, "OrderType": {"value": "DR"}, "Details": [{"InventoryID": {"value": "014431086625"}, "OrderQty": {"value": 1.0}, "UnitPrice": {"value": 0.02}, "WarehouseID": {"value": "999"}, "Operation": {"value": "Issue"}}, {"InventoryID": {"value": "015882002264"}, "OrderQty": {"value": 1.0}, "UnitPrice": {"value": 2.08}, "WarehouseID": {"value": "999"}, "Operation": {"value": "Issue"}}, {"InventoryID": {"value": "015882075367"}, "OrderQty": {"value": 1.0}, "UnitPrice": {"value": 0.12}, "WarehouseID": {"value": "999"}, "Operation": {"value": "Issue"}}, {"InventoryID": {"value": "015882075473"}, "OrderQty": {"value": 1.0}, "UnitPrice": {"value": 4.33}, "WarehouseID": {"value": "999"}, "Operation": {"value": "Issue"}}, {"InventoryID": {"value": "022945071808"}, "OrderQty": {"value": 1.0}, "UnitPrice": {"value": 0.02}, "WarehouseID": {"value": "999"}, "Operation": {"value": "Issue"}}, {"InventoryID": {"value": "022945200925"}, "OrderQty": {"value": 1.0}, "UnitPrice": {"value": 0.06}, "WarehouseID": {"value": "999"}, "Operation": {"value": "Issue"}}]}
I left it running for at least 5 mins and nothing happens. Any insight would be appreciated!
thanks