diff --git a/ShopifySharp/Entities/Checkout.cs b/ShopifySharp/Entities/Checkout.cs index ceb42eb0..b8247f89 100644 --- a/ShopifySharp/Entities/Checkout.cs +++ b/ShopifySharp/Entities/Checkout.cs @@ -184,7 +184,13 @@ public class Checkout : ShopifyObject /// [JsonProperty("total_discounts")] public decimal? TotalDiscounts { get; set; } - + + /// + /// The total duties of the checkout in presentment currency. + /// + [JsonProperty("total_duties")] + public decimal? TotalDuties { get; set; } + /// /// The sum of all the prices of all the items in the order. /// diff --git a/ShopifySharp/Entities/LineItem.cs b/ShopifySharp/Entities/LineItem.cs index e603e882..fb77332f 100644 --- a/ShopifySharp/Entities/LineItem.cs +++ b/ShopifySharp/Entities/LineItem.cs @@ -174,5 +174,11 @@ public class LineItem : ShopifyObject /// [JsonProperty("price_set")] public PriceSet PriceSet { get; set; } + + /// + /// A list of duty objects, each containing information about a duty on the line item + /// + [JsonProperty("duties")] + public IEnumerable Duties { get; set; } } } diff --git a/ShopifySharp/Entities/LineItemDuty.cs b/ShopifySharp/Entities/LineItemDuty.cs new file mode 100644 index 00000000..d377a059 --- /dev/null +++ b/ShopifySharp/Entities/LineItemDuty.cs @@ -0,0 +1,25 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ShopifySharp +{ + public class LineItemDuty : ShopifyObject + { + [JsonProperty("harmonized_system_code")] + public string HarmonizedSystemCode { get; set; } + + [JsonProperty("country_code_of_origin")] + public string CountryCodeOfOrigin { get; set; } + + [JsonProperty("shop_money")] + public Price ShopMoney { get; set; } + + [JsonProperty("presentment_money")] + public Price PresentmentMoney { get; set; } + + [JsonProperty("tax_lines")] + public IEnumerable TaxLines { get; set; } + } +} diff --git a/ShopifySharp/Entities/Location.cs b/ShopifySharp/Entities/Location.cs index d3045a16..6543204a 100644 --- a/ShopifySharp/Entities/Location.cs +++ b/ShopifySharp/Entities/Location.cs @@ -97,5 +97,17 @@ public class Location : ShopifyObject /// [JsonProperty("legacy")] public bool? Legacy { get; set; } + + /// + /// The localized name of the location's country. + /// + [JsonProperty("localized_country_name")] + public string LocalizedCountryName { get; set; } + + /// + /// The localized name of the location's region. Typically a province, state, or prefecture. + /// + [JsonProperty("localized_province_name")] + public string LocalizedProvinceName { get; set; } } } diff --git a/ShopifySharp/Entities/Order.cs b/ShopifySharp/Entities/Order.cs index 0d942a4a..98c32e33 100644 --- a/ShopifySharp/Entities/Order.cs +++ b/ShopifySharp/Entities/Order.cs @@ -342,5 +342,17 @@ public class Order : ShopifyObject /// [JsonProperty("metafields")] public IEnumerable Metafields { get; set; } + + /// + /// The current total duties charged on the order in shop and presentment currencies. + /// + [JsonProperty("current_total_duties_set")] + public PriceSet CurrentTotalDutiesSet { get; set; } + + /// + /// The original total duties charged on the order in shop and presentment currencies. + /// + [JsonProperty("original_total_duties_set")] + public PriceSet OriginalTotalDutiesSet { get; set; } } } diff --git a/ShopifySharp/Entities/Refund.cs b/ShopifySharp/Entities/Refund.cs index d70560ea..ae9f94ba 100644 --- a/ShopifySharp/Entities/Refund.cs +++ b/ShopifySharp/Entities/Refund.cs @@ -68,6 +68,12 @@ public class Refund : ShopifyObject /// [JsonProperty("user_id")] public long? UserId { get; set; } + + /// + /// A list of duties that have been returned as part of the refund. + /// + [JsonProperty("duties")] + public IEnumerable Duties { get; set; } } public class Shipping diff --git a/ShopifySharp/Entities/RefundDuty.cs b/ShopifySharp/Entities/RefundDuty.cs new file mode 100644 index 00000000..dfec3d51 --- /dev/null +++ b/ShopifySharp/Entities/RefundDuty.cs @@ -0,0 +1,16 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ShopifySharp +{ + public class RefundDuty + { + [JsonProperty("duty_id")] + public long? DutyId { get; set; } + + [JsonProperty("amount_set")] + public PriceSet AmountSet { get; set; } + } +} diff --git a/ShopifySharp/Services/Collection/CollectionService.cs b/ShopifySharp/Services/Collection/CollectionService.cs index 2dfe26b5..5e76eaf5 100644 --- a/ShopifySharp/Services/Collection/CollectionService.cs +++ b/ShopifySharp/Services/Collection/CollectionService.cs @@ -10,11 +10,6 @@ namespace ShopifySharp /// public class CollectionService : ShopifyService { - /// - /// This endpoint is not supported in 2019-10. - /// - public override string APIVersion => "2020-07"; - /// /// Creates a new instance of the service. /// diff --git a/ShopifySharp/Services/ShopifyService.cs b/ShopifySharp/Services/ShopifyService.cs index 4f79cd2c..8944cd5e 100644 --- a/ShopifySharp/Services/ShopifyService.cs +++ b/ShopifySharp/Services/ShopifyService.cs @@ -15,7 +15,7 @@ namespace ShopifySharp { public abstract class ShopifyService { - public virtual string APIVersion => "2019-10"; + public virtual string APIVersion => "2020-07"; private static IRequestExecutionPolicy _GlobalExecutionPolicy = new DefaultRequestExecutionPolicy();