diff --git a/Shippo/CustomsDeclaration.cs b/Shippo/CustomsDeclaration.cs index a63c217..2c04ca2 100644 --- a/Shippo/CustomsDeclaration.cs +++ b/Shippo/CustomsDeclaration.cs @@ -22,6 +22,13 @@ public class InvoicedCharges : ShippoId public object OtherFees { get; set; } } + [JsonObject(MemberSerialization.OptIn)] + public class ExporterIdentification : ShippoId + { + [JsonProperty(PropertyName = "eori_number")] + public object EoriNumber { get; set; } + } + [JsonObject(MemberSerialization.OptIn)] public class CustomsDeclaration : ShippoId { [JsonProperty(PropertyName = "object_created")] @@ -98,6 +105,9 @@ public class CustomsDeclaration : ShippoId { [JsonProperty(PropertyName = "invoiced_charges")] public InvoicedCharges InvoicedCharges { get; set; } + + [JsonProperty(PropertyName = "exporter_identification")] + public ExporterIdentification ExporterIdentification { get; set; } } } diff --git a/Shippo/Shippo.csproj b/Shippo/Shippo.csproj index 49e0885..066b34c 100644 --- a/Shippo/Shippo.csproj +++ b/Shippo/Shippo.csproj @@ -2,14 +2,14 @@ net45;net40 - 3.1.0 + 3.1.1 Shippo client library .NET library which integrates with Shippo Multi Carrier Shipping API. This library provides access to Shippo (goshippo.com) API capabilities. Including label generation, rating, tracking and more. Shippo Shipping API client Library (USPS, FedEx, UPS, and more) https://github.com/goshippo/shippo-csharp-client/ https://github.com/goshippo/shippo-csharp-client/ USPS Fedex UPS API Shippo - Added Tracking Sub-statuses and additional Customs and Manifest testing + Adding EORI support Github false diff --git a/ShippoTesting/CustomsDeclarationTest.cs b/ShippoTesting/CustomsDeclarationTest.cs index e552382..cb3466a 100644 --- a/ShippoTesting/CustomsDeclarationTest.cs +++ b/ShippoTesting/CustomsDeclarationTest.cs @@ -41,6 +41,9 @@ public void TestValidCreate() Assert.AreEqual(invoicedChargesParameters["total_duties"], testObject.InvoicedCharges.TotalDuties); Assert.AreEqual(invoicedChargesParameters["other_fees"], testObject.InvoicedCharges.OtherFees); Assert.AreEqual(invoicedChargesParameters["currency"], testObject.InvoicedCharges.Currency); + + var exporterIdentificationParameters = (Dictionary)parameters["exporter_identification"]; + Assert.AreEqual(exporterIdentificationParameters["eori_number"], testObject.ExporterIdentification.EoriNumber); } [Test] @@ -111,6 +114,11 @@ public static Hashtable getDefaultParameters() }; parameters.Add("invoiced_charges", invoicedCharges); + var exporterIdentification = new Dictionary(){ + {"eori_number", "PL12345678912345"}, + }; + parameters.Add("exporter_identification", exporterIdentification); + return parameters; }