I am trying to figure out a way to update Fulfillment status and Confirm a shipment in one call instead of doing 2 separate calls, to get this approach working would it be difficult to extend the web service endpoints?
Do y’all have any better option or the best way to go is make multiple calls?
Confirm Shipment API call
- Call #1 will trigger execution of shipment confirmation
- Call #2 will validate if shipment was confirmed
- Call #3 will get shipment information
you can achieve syntactic sugar within one line of code, but behind the curtains two or three api call will be needed.
Thank you both for looking into this and helping me out, greatly appreciate this.
You can check this repository:
https://github.com/Acumatica/AcumaticaRESTAPIClientForCSharp
And there is the sample of shipment confirmation:
var configuration = authApi.LogIn(username, password, tenant, branch, locale);
Console.WriteLine("Reading Accounts...");
var accountApi = new AccountApi(configuration);
var accounts = accountApi.GetList(top: 5);
foreach (var account in accounts)
{
Console.WriteLine("Account Nbr: " + account.AccountCD.Value + ";");
}
Console.WriteLine("Reading Sales Order by Keys...");
var salesOrderApi = new SalesOrderApi(configuration);
var order = salesOrderApi.GetByKeys(new List<string>() { "SO", "SO005207" });
Console.WriteLine("Order Total: " + order.OrderTotal.Value);
var shipmentApi = new ShipmentApi(configuration);
var shipment = shipmentApi.GetByKeys(new List<string>() { "002805" });
Console.WriteLine("ConfirmShipment");
shipmentApi.WaitActionCompletion(shipmentApi.InvokeAction(new ConfirmShipment(shipment)));
in the file RESTExample.cs .
We have a built-in functionality in Acumatica with the below code. I just checked and it is working fine.
Please check.
Func<PXGraph, IFinPeriodRepository> factoryFunc = (Func<PXGraph, IFinPeriodRepository>)ServiceLocator.Current.GetService(typeof(Func<PXGraph, IFinPeriodRepository>));
IFinPeriodRepository service = factoryFunc(Base);
FinPeriod finPeriod = service.GetFinPeriodByDate(Base.Document.Current.OrderDate, FinPeriod.organizationID.MasterValue);
PXTrace.WriteInformation(finPeriod.FinPeriodID);
Hope this helps!!
Hi Yuriy and Naveen,
So when I get the update from a 3pl about the shipment status, I would like to take that to ACM and update the same in one PUT/POST call
Is that possible?
I followed this to make the confirm shipment happen
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.