Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# EasyPost:无法创建清单。指定装运的货物中有5件已经报关:_C#_Usps_Easypost - Fatal编程技术网

C# EasyPost:无法创建清单。指定装运的货物中有5件已经报关:

C# EasyPost:无法创建清单。指定装运的货物中有5件已经报关:,c#,usps,easypost,C#,Usps,Easypost,创建扫描表单时,EasyPost返回以下错误。我如何确定货物是否已报关或无法报关 无法创建清单。指定装运的货物中有5件已装运 已显示:shp_aa、shp_xxx、shp_yy、shp_vv、shp_xx var-apiKey=ConfigurationManager.AppSettings[“EasyPostAPIKey”]; EasyPost.ClientManager.SetCurrent(apiKey); 如果(shipmentsPurchasedInDateRange.Count>0)

创建扫描表单时,EasyPost返回以下错误。我如何确定货物是否已报关或无法报关

无法创建清单。指定装运的货物中有5件已装运 已显示:shp_aa、shp_xxx、shp_yy、shp_vv、shp_xx

var-apiKey=ConfigurationManager.AppSettings[“EasyPostAPIKey”];
EasyPost.ClientManager.SetCurrent(apiKey);
如果(shipmentsPurchasedInDateRange.Count>0)
{
var装运=新列表();
foreach(shipmentsPurchasedInDateRange中的var shipmentId)
{
var装运=新的EasyPost.Shipping()
{
id=shipmentId,
};
装运。添加(装运);
}
var scanForm=scanForm.Create(装运);
返回scanForm.form_url;
}

如果您需要对多个装运进行清单显示,建议您创建一个包含所有装运的批次。一些承运人要求所有装运都要显示,因此建议为一天内创建的所有装运创建一个批次,然后显示该批次

以下是工作流程: 创建当天的发货 在一天结束时创建一个批。 创建批次时,您可以使用数组中的装运ID创建批次。 或者,您可以将装运添加到批次中,只要尚未扫描成型。这意味着您可以在每天开始时创建一个批。然后,在创建装运时,您可以将其添加到批次中。 创建所有装运并添加到批次后,您可以扫描批次

var apiKey = ConfigurationManager.AppSettings["EasyPostAPIKey"];
            EasyPost.ClientManager.SetCurrent(apiKey);

            if (shipmentsPurchasedInDateRange.Count > 0)
            {
                var shipments = new List<EasyPost.Shipment>();
                foreach (var shipmentId in shipmentsPurchasedInDateRange)
                {
                    var shipment = new EasyPost.Shipment()
                    {
                        id = shipmentId,
                    };
                    shipments.Add(shipment);


                }

                var scanForm = ScanForm.Create(shipments);
                return scanForm.form_url;
            }