From fcc34e4f624b9687fa3326df9e2f46bf415f86bc Mon Sep 17 00:00:00 2001 From: Andrew Pirelli Date: Wed, 23 Sep 2026 19:21:46 +0000 Subject: [PATCH 1/4] INSR-159: Add line_items to Create a Shipment examples Getting Started and the Shipment docs use these samples. line_items supply USPS Claims product value and are not returned on the Shipment. Co-authored-by: Cursor --- official/docs/csharp/current/shipments/create.cs | 12 +++++++++++- official/docs/curl/current/shipments/create.sh | 12 +++++++++++- official/docs/golang/current/shipments/create.go | 10 ++++++++++ official/docs/java/current/shipments/create.java | 15 +++++++++++++++ official/docs/node/current/shipments/create.js | 8 ++++++++ official/docs/php/current/shipments/create.php | 10 ++++++++++ official/docs/python/current/shipments/create.py | 8 ++++++++ official/docs/ruby/current/shipments/create.rb | 10 ++++++++++ 8 files changed, 83 insertions(+), 2 deletions(-) diff --git a/official/docs/csharp/current/shipments/create.cs b/official/docs/csharp/current/shipments/create.cs index 22d54dec..4528203f 100644 --- a/official/docs/csharp/current/shipments/create.cs +++ b/official/docs/csharp/current/shipments/create.cs @@ -46,6 +46,11 @@ public static async Task Main() CustomsInfo = new EasyPost.Parameters.CustomsInfo.Create { // ... + }, + LineItems = new List + { + new EasyPost.Models.API.LineItem { TotalLineValue = "129.00", ItemDescription = "Mugs" }, + new EasyPost.Models.API.LineItem { TotalLineValue = "45.50", ItemDescription = "T-shirts" }, } }; @@ -65,7 +70,12 @@ public static async Task Main() ToAddress = toAddress, FromAddress = fromAddress, Parcel = parcel, - CustomsInfo = customsInfo + CustomsInfo = customsInfo, + LineItems = new List + { + new EasyPost.Models.API.LineItem { TotalLineValue = "129.00", ItemDescription = "Mugs" }, + new EasyPost.Models.API.LineItem { TotalLineValue = "45.50", ItemDescription = "T-shirts" }, + } }; shipment = await client.Shipment.Create(parameters); diff --git a/official/docs/curl/current/shipments/create.sh b/official/docs/curl/current/shipments/create.sh index 6d2f7fd8..9fb09deb 100755 --- a/official/docs/curl/current/shipments/create.sh +++ b/official/docs/curl/current/shipments/create.sh @@ -32,6 +32,16 @@ curl -X POST https://api.easypost.com/v2/shipments \ }, "customs_info": { "id": "cstinfo_..." - } + }, + "line_items": [ + { + "total_line_value": "129.00", + "item_description": "Mugs" + }, + { + "total_line_value": "45.50", + "item_description": "T-shirts" + } + ] } }' diff --git a/official/docs/golang/current/shipments/create.go b/official/docs/golang/current/shipments/create.go index 0d204bee..54869c41 100644 --- a/official/docs/golang/current/shipments/create.go +++ b/official/docs/golang/current/shipments/create.go @@ -41,6 +41,16 @@ func create() { CustomsInfo: &easypost.CustomsInfo{ ID: "cstinfo_...", }, + LineItems: []*easypost.LineItem{ + { + TotalLineValue: "129.00", + ItemDescription: "Mugs", + }, + { + TotalLineValue: "45.50", + ItemDescription: "T-shirts", + }, + }, }, ) diff --git a/official/docs/java/current/shipments/create.java b/official/docs/java/current/shipments/create.java index 19651a45..abb084c3 100644 --- a/official/docs/java/current/shipments/create.java +++ b/official/docs/java/current/shipments/create.java @@ -4,7 +4,9 @@ import com.easypost.model.Shipment; import com.easypost.service.EasyPostClient; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; public class Create { public static void main(String[] args) throws EasyPostException { @@ -40,11 +42,24 @@ public static void main(String[] args) throws EasyPostException { HashMap customsInfoMap = new HashMap(); customsInfoMap.put("id", "cstinfo_..."); + HashMap mugLineItem = new HashMap(); + mugLineItem.put("total_line_value", "129.00"); + mugLineItem.put("item_description", "Mugs"); + + HashMap shirtLineItem = new HashMap(); + shirtLineItem.put("total_line_value", "45.50"); + shirtLineItem.put("item_description", "T-shirts"); + + List> lineItems = new ArrayList>(); + lineItems.add(mugLineItem); + lineItems.add(shirtLineItem); + HashMap params = new HashMap(); params.put("to_address", toAddressMap); params.put("from_address", fromAddressMap); params.put("parcel", parcelMap); params.put("customs_info", customsInfoMap); + params.put("line_items", lineItems); Shipment shipment = client.shipment.create(params); diff --git a/official/docs/node/current/shipments/create.js b/official/docs/node/current/shipments/create.js index 32d96ea5..e70ad45b 100644 --- a/official/docs/node/current/shipments/create.js +++ b/official/docs/node/current/shipments/create.js @@ -33,6 +33,10 @@ const client = new EasyPostClient('EASYPOST_API_KEY'); weight: 65.9, }, customs_info: { id: 'cstinfo_...' }, + line_items: [ + { total_line_value: '129.00', item_description: 'Mugs' }, + { total_line_value: '45.50', item_description: 'T-shirts' }, + ], }); // or create by using IDs @@ -42,6 +46,10 @@ const client = new EasyPostClient('EASYPOST_API_KEY'); from_address: { id: 'adr_...' }, parcel: { id: 'prcl_...' }, customs_info: { id: 'cstinfo_...' }, + line_items: [ + { total_line_value: '129.00', item_description: 'Mugs' }, + { total_line_value: '45.50', item_description: 'T-shirts' }, + ], }); console.log(shipment); diff --git a/official/docs/php/current/shipments/create.php b/official/docs/php/current/shipments/create.php index 8dfcab66..1302d763 100644 --- a/official/docs/php/current/shipments/create.php +++ b/official/docs/php/current/shipments/create.php @@ -29,6 +29,16 @@ 'width' => 10.9, 'height' => 5, 'weight' => 65.9 + ], + 'line_items' => [ + [ + 'total_line_value' => '129.00', + 'item_description' => 'Mugs' + ], + [ + 'total_line_value' => '45.50', + 'item_description' => 'T-shirts' + ] ] ]); diff --git a/official/docs/python/current/shipments/create.py b/official/docs/python/current/shipments/create.py index 4d113f6c..2f9abd95 100644 --- a/official/docs/python/current/shipments/create.py +++ b/official/docs/python/current/shipments/create.py @@ -31,6 +31,10 @@ "weight": 65.9, }, customs_info={"id": "cstinfo_..."}, + line_items=[ + {"total_line_value": "129.00", "item_description": "Mugs"}, + {"total_line_value": "45.50", "item_description": "T-shirts"}, + ], ) # or create by using IDs @@ -40,6 +44,10 @@ from_address={"id": "adr_..."}, parcel={"id": "prcl_..."}, customs_info={"id": "cstinfo_..."}, + line_items=[ + {"total_line_value": "129.00", "item_description": "Mugs"}, + {"total_line_value": "45.50", "item_description": "T-shirts"}, + ], ) print(shipment) diff --git a/official/docs/ruby/current/shipments/create.rb b/official/docs/ruby/current/shipments/create.rb index c22548f8..4c435e82 100644 --- a/official/docs/ruby/current/shipments/create.rb +++ b/official/docs/ruby/current/shipments/create.rb @@ -33,6 +33,16 @@ customs_info: { id: 'cstinfo_...', }, + line_items: [ + { + total_line_value: '129.00', + item_description: 'Mugs', + }, + { + total_line_value: '45.50', + item_description: 'T-shirts', + }, + ], ) puts shipment From 529ab159afab2b961b09fd6219eee7abc2ff6cef Mon Sep 17 00:00:00 2001 From: Andrew Pirelli Date: Wed, 23 Sep 2026 22:21:58 +0000 Subject: [PATCH 2/4] INSR-159: Use easypost-go v5.6.0 so shipment line_items typecheck The Create a Shipment example sets LineItems. That field is on the Go client starting in v5.6.0. Co-authored-by: Cursor --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f50c2c9d..4f2a7ebc 100644 --- a/go.mod +++ b/go.mod @@ -6,5 +6,5 @@ require ( github.com/EasyPost/easypost-go/v2 v2.20.0 github.com/EasyPost/easypost-go/v3 v3.2.0 github.com/EasyPost/easypost-go/v4 v4.6.0 - github.com/EasyPost/easypost-go/v5 v5.2.0 + github.com/EasyPost/easypost-go/v5 v5.6.0 ) diff --git a/go.sum b/go.sum index a9c171a7..0f542b5a 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,8 @@ github.com/EasyPost/easypost-go/v3 v3.2.0 h1:dNWmPG1AkpgYFJxhw/zGzCz1JOVXPpNIi8+ github.com/EasyPost/easypost-go/v3 v3.2.0/go.mod h1:WDD0qkjwxedVKFXCcdJBz22rtRHpuxjGazgSVcTfdIw= github.com/EasyPost/easypost-go/v4 v4.6.0 h1:wxMK4wkGEG5vW/4Vdy3rwE9iqww1eQ1xS6oYWUZbhrc= github.com/EasyPost/easypost-go/v4 v4.6.0/go.mod h1:WGoS4tmjHquhooMNmY6RirP+KWeYV/akcf/Jg9Q6fsk= -github.com/EasyPost/easypost-go/v5 v5.2.0 h1:UKv0AWKugaue3QGW1RvTBg6/V1Gy/QGCXVC458bcQYU= -github.com/EasyPost/easypost-go/v5 v5.2.0/go.mod h1:wUxStg92sBzWO3m2yoFAN7CbZTr25zQeFog48itvfnw= +github.com/EasyPost/easypost-go/v5 v5.6.0 h1:2Vs2zGE2tyKVjUpoL+r6lHUAgd+QWPT6FWjBywVh3D8= +github.com/EasyPost/easypost-go/v5 v5.6.0/go.mod h1:wUxStg92sBzWO3m2yoFAN7CbZTr25zQeFog48itvfnw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= From f0c085240c377156de0757b117adb95197380085 Mon Sep 17 00:00:00 2001 From: Andrew Pirelli Date: Wed, 23 Sep 2026 22:31:07 +0000 Subject: [PATCH 3/4] INSR-159: Pin EasyPost-Official 7.5.0 for shipment line items Co-authored-by: Cursor --- examples.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples.csproj b/examples.csproj index 010bfc84..4f32aaeb 100644 --- a/examples.csproj +++ b/examples.csproj @@ -12,7 +12,7 @@ - + From e4039e0367f2988fe4417b845aa2485c431f59d1 Mon Sep 17 00:00:00 2001 From: Andrew Pirelli Date: Fri, 25 Sep 2026 20:51:38 +0000 Subject: [PATCH 4/4] INSR-159: Drop customs_info from the line_items shipment examples Product value comes from line_items. The customs id stub made the sample look like both are required. --- official/docs/csharp/current/shipments/create.cs | 8 +------- official/docs/curl/current/shipments/create.sh | 3 --- official/docs/golang/current/shipments/create.go | 3 --- official/docs/java/current/shipments/create.java | 4 ---- official/docs/node/current/shipments/create.js | 2 -- official/docs/python/current/shipments/create.py | 2 -- official/docs/ruby/current/shipments/create.rb | 3 --- 7 files changed, 1 insertion(+), 24 deletions(-) diff --git a/official/docs/csharp/current/shipments/create.cs b/official/docs/csharp/current/shipments/create.cs index 4528203f..5ea6f2a1 100644 --- a/official/docs/csharp/current/shipments/create.cs +++ b/official/docs/csharp/current/shipments/create.cs @@ -43,10 +43,6 @@ public static async Task Main() Height = 5, Weight = 10 }, - CustomsInfo = new EasyPost.Parameters.CustomsInfo.Create - { - // ... - }, LineItems = new List { new EasyPost.Models.API.LineItem { TotalLineValue = "129.00", ItemDescription = "Mugs" }, @@ -58,19 +54,17 @@ public static async Task Main() Console.WriteLine(JsonConvert.SerializeObject(shipment, Formatting.Indented)); - // Create a shipment using existing addresses, parcel, and customs info + // Create a shipment using existing addresses and parcel EasyPost.Models.API.Address toAddress = await client.Address.Retrieve("adr_..."); EasyPost.Models.API.Address fromAddress = await client.Address.Retrieve("adr_..."); EasyPost.Models.API.Parcel parcel = await client.Parcel.Retrieve("prcl_..."); - EasyPost.Models.API.CustomsInfo customsInfo = await client.CustomsInfo.Retrieve("cstinfo_..."); parameters = new() { ToAddress = toAddress, FromAddress = fromAddress, Parcel = parcel, - CustomsInfo = customsInfo, LineItems = new List { new EasyPost.Models.API.LineItem { TotalLineValue = "129.00", ItemDescription = "Mugs" }, diff --git a/official/docs/curl/current/shipments/create.sh b/official/docs/curl/current/shipments/create.sh index 9fb09deb..92cdc17c 100755 --- a/official/docs/curl/current/shipments/create.sh +++ b/official/docs/curl/current/shipments/create.sh @@ -30,9 +30,6 @@ curl -X POST https://api.easypost.com/v2/shipments \ "height": "5", "weight": "65.9" }, - "customs_info": { - "id": "cstinfo_..." - }, "line_items": [ { "total_line_value": "129.00", diff --git a/official/docs/golang/current/shipments/create.go b/official/docs/golang/current/shipments/create.go index 54869c41..ae09b9ad 100644 --- a/official/docs/golang/current/shipments/create.go +++ b/official/docs/golang/current/shipments/create.go @@ -38,9 +38,6 @@ func create() { Height: 5, Weight: 65.9, }, - CustomsInfo: &easypost.CustomsInfo{ - ID: "cstinfo_...", - }, LineItems: []*easypost.LineItem{ { TotalLineValue: "129.00", diff --git a/official/docs/java/current/shipments/create.java b/official/docs/java/current/shipments/create.java index abb084c3..ed4c123f 100644 --- a/official/docs/java/current/shipments/create.java +++ b/official/docs/java/current/shipments/create.java @@ -39,9 +39,6 @@ public static void main(String[] args) throws EasyPostException { parcelMap.put("height", 5); parcelMap.put("weight", 65.9); - HashMap customsInfoMap = new HashMap(); - customsInfoMap.put("id", "cstinfo_..."); - HashMap mugLineItem = new HashMap(); mugLineItem.put("total_line_value", "129.00"); mugLineItem.put("item_description", "Mugs"); @@ -58,7 +55,6 @@ public static void main(String[] args) throws EasyPostException { params.put("to_address", toAddressMap); params.put("from_address", fromAddressMap); params.put("parcel", parcelMap); - params.put("customs_info", customsInfoMap); params.put("line_items", lineItems); Shipment shipment = client.shipment.create(params); diff --git a/official/docs/node/current/shipments/create.js b/official/docs/node/current/shipments/create.js index e70ad45b..88cf168e 100644 --- a/official/docs/node/current/shipments/create.js +++ b/official/docs/node/current/shipments/create.js @@ -32,7 +32,6 @@ const client = new EasyPostClient('EASYPOST_API_KEY'); height: 5, weight: 65.9, }, - customs_info: { id: 'cstinfo_...' }, line_items: [ { total_line_value: '129.00', item_description: 'Mugs' }, { total_line_value: '45.50', item_description: 'T-shirts' }, @@ -45,7 +44,6 @@ const client = new EasyPostClient('EASYPOST_API_KEY'); to_address: { id: 'adr_...' }, from_address: { id: 'adr_...' }, parcel: { id: 'prcl_...' }, - customs_info: { id: 'cstinfo_...' }, line_items: [ { total_line_value: '129.00', item_description: 'Mugs' }, { total_line_value: '45.50', item_description: 'T-shirts' }, diff --git a/official/docs/python/current/shipments/create.py b/official/docs/python/current/shipments/create.py index 2f9abd95..7d1d0d9e 100644 --- a/official/docs/python/current/shipments/create.py +++ b/official/docs/python/current/shipments/create.py @@ -30,7 +30,6 @@ "height": 5, "weight": 65.9, }, - customs_info={"id": "cstinfo_..."}, line_items=[ {"total_line_value": "129.00", "item_description": "Mugs"}, {"total_line_value": "45.50", "item_description": "T-shirts"}, @@ -43,7 +42,6 @@ to_address={"id": "adr_..."}, from_address={"id": "adr_..."}, parcel={"id": "prcl_..."}, - customs_info={"id": "cstinfo_..."}, line_items=[ {"total_line_value": "129.00", "item_description": "Mugs"}, {"total_line_value": "45.50", "item_description": "T-shirts"}, diff --git a/official/docs/ruby/current/shipments/create.rb b/official/docs/ruby/current/shipments/create.rb index 4c435e82..39b35b71 100644 --- a/official/docs/ruby/current/shipments/create.rb +++ b/official/docs/ruby/current/shipments/create.rb @@ -30,9 +30,6 @@ height: 5, weight: 65.9, }, - customs_info: { - id: 'cstinfo_...', - }, line_items: [ { total_line_value: '129.00',