首页 > 解决方案 > Shippo Tracking FeDex Error in Json Serialization in C#

问题描述

I was trying to use the project ShippingTesting in Visual Studio(C#). I tried UPS which works great.
But when I tried FeDex, it threw an error saying:

"Newtonsoft.Json.JsonSerializationException", " Additional information: Error converting value "PRE_TRANSIT" to type 'Shippo.ShippoEnums+TrackingStatus'. Path 'tracking_history[0].status',"

It looks like a JSON serialization issue. Will this be a constant issue with Fedex?
Thanks!

标签: c#jsonserializationshippo

解决方案


在最新版本的 API 中添加了“PRE_TRANSIT”作为可能的状态(当标签已创建但尚未进入传输时,它会替换旧的初始“未知”状态)。

可能需要更新 C# 库以支持此附加映射。作为一种解决方法,您可以在请求的标头中传递较旧的 API 版本(“2018-02-08”之前),这应该返回旧的“未知”映射。

参考:https ://goshippo.com/docs/changelog


推荐阅读