From 4d040086b11aa6c98c5323147a7a2507e75a4d4d Mon Sep 17 00:00:00 2001
From: Justintime50 <39606064+Justintime50@users.noreply.github.com>
Date: Tue, 3 Feb 2026 16:21:36 -0700
Subject: [PATCH] fix: correct usage of line items shipment property (closes
#645)
---
EasyPost/Models/API/LineItem.cs | 27 ++++++++++++++++++++++++++
EasyPost/Models/API/Shipment.cs | 6 ++++++
EasyPost/Parameters/IParameter.cs | 7 +++++++
EasyPost/Parameters/Shipment/Create.cs | 20 ++-----------------
4 files changed, 42 insertions(+), 18 deletions(-)
create mode 100644 EasyPost/Models/API/LineItem.cs
diff --git a/EasyPost/Models/API/LineItem.cs b/EasyPost/Models/API/LineItem.cs
new file mode 100644
index 000000000..e49ebe83c
--- /dev/null
+++ b/EasyPost/Models/API/LineItem.cs
@@ -0,0 +1,27 @@
+using EasyPost._base;
+using Newtonsoft.Json;
+
+namespace EasyPost.Models.API
+{
+ ///
+ /// Class representing line items of a Shipment.
+ ///
+ public class LineItem : EasyPostObject, Parameters.ILineItemParameter
+ {
+ #region JSON Properties
+
+ ///
+ /// The total value of the line item.
+ ///
+ [JsonProperty("total_line_value")]
+ public string? TotalLineValue { get; set; }
+
+ ///
+ /// The description of the item.
+ ///
+ [JsonProperty("item_description")]
+ public string? ItemDescription { get; set; }
+
+ #endregion
+ }
+}
diff --git a/EasyPost/Models/API/Shipment.cs b/EasyPost/Models/API/Shipment.cs
index 800ea17c2..7711819a2 100644
--- a/EasyPost/Models/API/Shipment.cs
+++ b/EasyPost/Models/API/Shipment.cs
@@ -77,6 +77,12 @@ public class Shipment : EasyPostObject, Parameters.IShipmentParameter
[JsonProperty("is_return")]
public bool? IsReturn { get; set; }
+ ///
+ /// A list of s associated with the shipment.
+ ///
+ [JsonProperty("line_items")]
+ public List? LineItems { get; set; }
+
///
/// A list of any carrier errors that occurred during rating or purchasing.
///
diff --git a/EasyPost/Parameters/IParameter.cs b/EasyPost/Parameters/IParameter.cs
index 451f84900..ccca58f0f 100644
--- a/EasyPost/Parameters/IParameter.cs
+++ b/EasyPost/Parameters/IParameter.cs
@@ -63,6 +63,13 @@ public interface IInsuranceParameter : IParameter
{
}
+ ///
+ /// An interface marking that an instance of the implementing class can be used as a line item parameter in a Parameters object.
+ ///
+ public interface ILineItemParameter : IParameter
+ {
+ }
+
///
/// An interface marking that an instance of the implementing class can be used as an order parameter in a Parameters object.
///
diff --git a/EasyPost/Parameters/Shipment/Create.cs b/EasyPost/Parameters/Shipment/Create.cs
index 8ca6b6353..0f3a1e4bc 100644
--- a/EasyPost/Parameters/Shipment/Create.cs
+++ b/EasyPost/Parameters/Shipment/Create.cs
@@ -155,27 +155,11 @@ public class Create : BaseParameters, IShipmentParameter
public List? CarrierAccountIds { get; set; }
///
- /// A list of line items for the new .
+ /// A list of s for the new .
///
[TopLevelRequestParameter(Necessity.Optional, "shipment", "line_items")]
[NestedRequestParameter(typeof(Order.Create), Necessity.Optional, "line_items")]
- public List? LineItems { get; set; }
-
- ///
- /// Represents a line item for a shipment.
- ///
- public class LineItem
- {
- ///
- /// The total value of the line item.
- ///
- public string? TotalLineValue { get; set; }
-
- ///
- /// The description of the item.
- ///
- public string? ItemDescription { get; set; }
- }
+ public List? LineItems { get; set; }
#endregion
}