janssenr / SendCloudApi.Net

A C#/.net wrapper for the SendCloud API
MIT License
6 stars 5 forks source link

Error deserializing #12

Closed veronicaDesantis closed 3 years ago

veronicaDesantis commented 3 years ago

Hi, following your instruction in creating a parcel this is the error we are getting:

The data contract type 'SendCloudApi.Net.Models.Country' cannot be deserialized because the required data members 'from_id, from_iso_2, from_iso_3, from_name' were not found.'

This is the code: var parcel = new CreateParcel { Name = "John Smith", CompanyName = "ACME", Address = "Wellingtonstreet 25", City = "Wellington", PostalCode = "3423 DD", Country = "NL", RequestLabel = true, ShippingMethod = 8, // Shipping method, get possibilities from client.ShippingMethods.Get() OrderNumber = "ORDER2014-52321", }; try { var response = await client.Parcels.Create(parcel); } catch (SendCloudException e) { throw new Exception(e.Message); }

janssenr commented 3 years ago

Should be fixed now. Set IsRequired to false for Country fields

veronicaDesantis commented 3 years ago

Thank you!