Closeout LTL |
[This is preliminary documentation and is subject to change.]
For an order to be included in a close out it must be valid, but labels for containers do not need to be printed first.
It is important that each container and pallet included in a close out actually be shipped on the ship date since a close out may generate customs documentation or trigger other procedures which enable them to be shipped without incident. It is also important to not include containers and pallets which aren't actually shipped since you will be billed for everything included in the closed out.
When all containers and pallets are ready to ship (and any container labels have been attached), create a LTL Closeout to complete processing.
A CloseoutRequestLTL requires either ProNumbers or customer generated LTLNumbers to identify which pallets are included. To include any non-LTL parcels in the closeout, include either Pins or customer generated PackageIDs to identify the included parcels, and specify the number of non-LTL pallets.
string[] proNumbers = validOrders.Select(o => o.ProNumber).ToArray(); string[] containerPins = validOrders.SelectMany(o => o.Packages.Select(p => p.TrackingNumber)).ToArray(); CloseoutRequestLTL ltlCloseoutRequest = new CloseoutRequestLTL { Credentials = credentials, ShipDate = DateTime.Today, LTLNumberType = "PRONUMBER", LTLNumbers = proNumbers, PackIDType = "Pin", PackageIDs = containerPins, ParsNumber = "12-14799632", // Only used by PARS customers. }; CloseoutResponseLTL closeoutResponseLTLResponse = client.CloseoutWithLTL(ltlCloseoutRequest); if (closeoutResponseLTLResponse.Status == (int)SeverityEnum.Error) { foreach (ResponseMessage message in closeoutResponseLTLResponse.Messages) { switch (message.Number) { case 1: // Invalid Credentials Console.Write("Invalid Credentials"); return closeoutResponseLTLResponse; case 71: // No packages to closeout - not found, not a courier package, label not printed, etc. return closeoutResponseLTLResponse; case 87: // PackIDType should be Pin or PackageID. ltlCloseoutRequest.PackIDType = "Pin"; break; case 88: // Package/container not found, or is not available for close out. // This can happen if the Package has been closed out or voided, or if it is from another account. return closeoutResponseLTLResponse; } // Add cases to fix other errors.... } closeoutResponseLTLResponse = client.CloseoutWithLTL(ltlCloseoutRequest); if (closeoutResponseLTLResponse.Status == (int)SeverityEnum.Error) return closeoutResponseLTLResponse; } // Handle any closeoutResponse.Documents
Print and apply the label for each pallet. See ZPL page for more information.
Create a Closeout(CloseoutRequest)
ParsNumber is required for PARS customers.
PackIDType must specify either Pin or PackageID.
PackageIDs must contain either a list of Purolator generated Pins (from the barcode section of the label) or the PackageIDs/Package Numbers for each included package depending on the value of PackIDType.
Save any Documents returned in the close out (if successful) response.
Save updated rates for the closed out packages if needed.
Example using ProNumbers
string[] proNumbers = validOrders.Select(o => o.ProNumber).ToArray(); string[] containerPins = validOrders.SelectMany(o => o.Packages.Select(p => p.TrackingNumber)).ToArray(); CloseoutRequestLTL ltlCloseoutRequest = new CloseoutRequestLTL { Credentials = credentials, ShipDate = DateTime.Today, LTLNumberType = "PRONUMBER", LTLNumbers = proNumbers, PackIDType = "Pin", PackageIDs = containerPins, ParsNumber = "12-14799632", // Only used by PARS customers. }; CloseoutResponseLTL closeoutResponseLTLResponse = client.CloseoutWithLTL(ltlCloseoutRequest); if (closeoutResponseLTLResponse.Status == (int)SeverityEnum.Error) { foreach (ResponseMessage message in closeoutResponseLTLResponse.Messages) { switch (message.Number) { case 1: // Invalid Credentials Console.Write("Invalid Credentials"); return closeoutResponseLTLResponse; case 71: // No packages to closeout - not found, not a courier package, label not printed, etc. return closeoutResponseLTLResponse; case 87: // PackIDType should be Pin or PackageID. ltlCloseoutRequest.PackIDType = "Pin"; break; case 88: // Package/container not found, or is not available for close out. // This can happen if the Package has been closed out or voided, or if it is from another account. return closeoutResponseLTLResponse; } // Add cases to fix other errors.... } closeoutResponseLTLResponse = client.CloseoutWithLTL(ltlCloseoutRequest); if (closeoutResponseLTLResponse.Status == (int)SeverityEnum.Error) return closeoutResponseLTLResponse; } // Handle any closeoutResponse.Documents
Example using LTLNumbers
CredentialInfo credentials = new CredentialInfo { UserName = "User", Password = "****", ClientID = "0000000" }; ShippingServicesSoapClient client = new ShippingServicesSoapClient("PurolatorWebService"); CloseoutRequestLTL ltlCloseoutRequest = new CloseoutRequestLTL { Credentials = credentials, ShipDate = DateTime.Today, LTLNumberType = "LTLNumber", LTLNumbers = ltlNumbers, PackIDType = "PackageID", PackageIDs = nonLTLPackageIDs, ParsNumber = "12-14799631", // Only used by PARS customers. SkidCount = (nonLTLPackageIDs.Count() > 0) ? 1 : 0, }; CloseoutResponseLTL closeoutResponseLTLResponse = client.CloseoutWithLTL(ltlCloseoutRequest); if (closeoutResponseLTLResponse.Status == (int)SeverityEnum.Error) { foreach (ResponseMessage message in closeoutResponseLTLResponse.Messages) { switch (message.Number) { case 1: // Invalid Credentials Console.Write("Invalid Credentials"); return; case 71: // No packages to closeout - not found, not a courier package, label not printed, etc. return; case 87: // PackIDType should be Pin or PackageID. ltlCloseoutRequest.PackIDType = "PackageID"; break; case 88: // Package(s) not found, or is not available for closeout. // This can happen if the Package has been closed out or voided, or if it is from another account. return; } } closeoutResponseLTLResponse = client.CloseoutWithLTL(ltlCloseoutRequest); if (closeoutResponseLTLResponse.Status == (int)SeverityEnum.Error) return; } // Handle any closeoutResponse.Documents
Example using LtlShipmentNumber
CredentialInfo credentials = new CredentialInfo { UserName = "User", Password = "****", ClientID = "0000000" }; ShippingServicesSoapClient client = new ShippingServicesSoapClient("PurolatorWebService"); CloseoutRequestLTL ltlCloseoutRequest = new CloseoutRequestLTL { Credentials = credentials, ShipDate = DateTime.Today, LTLNumberType = "LTLNUMBER", LTLNumbers = new[] { ltlShipmentNumber }, PackageIDs = new string[0], PackIDType = "Pin", ParsNumber = "12-14799636", // Only used by PARS customers. }; CloseoutResponseLTL closeoutResponseLTLResponse = client.CloseoutWithLTL(ltlCloseoutRequest); if (closeoutResponseLTLResponse.Status == (int)SeverityEnum.Error) { foreach (ResponseMessage message in closeoutResponseLTLResponse.Messages) { switch (message.Number) { case 1: // Invalid Credentials Console.Write("Invalid Credentials"); return; case 71: // No packages. case 79: // No packages. return; case 87: // PackIDType should be Pin or PackageID. ltlCloseoutRequest.PackIDType = "Pin"; break; case 88: // Package(s) not found, or is not available for closeout. // This can happen if the label isn't printed, if the package is voided, if the package isn't verified, ... return; } } closeoutResponseLTLResponse = client.CloseoutWithLTL(ltlCloseoutRequest); if (closeoutResponseLTLResponse.Status == (int)SeverityEnum.Error) return; } // Handle any closeoutResponse.Documents