diff --git a/Shippo/CustomsDeclaration.cs b/Shippo/CustomsDeclaration.cs
index 2c04ca2..dc56e71 100644
--- a/Shippo/CustomsDeclaration.cs
+++ b/Shippo/CustomsDeclaration.cs
@@ -27,6 +27,19 @@ public class ExporterIdentification : ShippoId
{
[JsonProperty(PropertyName = "eori_number")]
public object EoriNumber { get; set; }
+
+ [JsonProperty(PropertyName = "tax_id")]
+ public TaxId TaxId { get; set; }
+ }
+
+ [JsonObject(MemberSerialization.OptIn)]
+ public class TaxId : ShippoId
+ {
+ [JsonProperty(PropertyName = "number")]
+ public object Number { get; set; }
+
+ [JsonProperty(PropertyName = "type")]
+ public object Type { get; set; }
}
[JsonObject(MemberSerialization.OptIn)]
diff --git a/Shippo/Shippo.csproj b/Shippo/Shippo.csproj
index 066b34c..ad875ae 100644
--- a/Shippo/Shippo.csproj
+++ b/Shippo/Shippo.csproj
@@ -2,14 +2,14 @@
net45;net40
- 3.1.1
+ 3.2.0
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
- Adding EORI support
+ Adding support for tax IDs such as VAT and EIN for customs declarations
Github
false
diff --git a/ShippoTesting/CustomsDeclarationTest.cs b/ShippoTesting/CustomsDeclarationTest.cs
index cb3466a..ef94dc3 100644
--- a/ShippoTesting/CustomsDeclarationTest.cs
+++ b/ShippoTesting/CustomsDeclarationTest.cs
@@ -42,7 +42,10 @@ public void TestValidCreate()
Assert.AreEqual(invoicedChargesParameters["other_fees"], testObject.InvoicedCharges.OtherFees);
Assert.AreEqual(invoicedChargesParameters["currency"], testObject.InvoicedCharges.Currency);
- var exporterIdentificationParameters = (Dictionary)parameters["exporter_identification"];
+ var exporterIdentificationParameters = (Dictionary)parameters["exporter_identification"];
+ var taxIdParameters = (Dictionary) exporterIdentificationParameters["tax_id"];
+ Assert.AreEqual(taxIdParameters["number"], testObject.ExporterIdentification.TaxId.Number);
+ Assert.AreEqual(taxIdParameters["type"], testObject.ExporterIdentification.TaxId.Type);
Assert.AreEqual(exporterIdentificationParameters["eori_number"], testObject.ExporterIdentification.EoriNumber);
}
@@ -114,8 +117,14 @@ public static Hashtable getDefaultParameters()
};
parameters.Add("invoiced_charges", invoicedCharges);
- var exporterIdentification = new Dictionary(){
+ var taxId = new Dictionary()
+ {
+ {"number", "123456789"},
+ {"type", "EIN" }
+ };
+ var exporterIdentification = new Dictionary(){
{"eori_number", "PL12345678912345"},
+ {"tax_id", taxId}
};
parameters.Add("exporter_identification", exporterIdentification);