INSR-159: Add line_items to Create a Shipment examples - #237
Conversation
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 <cursoragent@cursor.com>
There was a problem hiding this comment.
I would caution against adding this to the examples and instead suggest documenting them on the actual docs.
The example snippets are intentionally left as simple and streamlined as possible. They're meant to be an easy copy/paste/try while integrating vs listing all possible options (especially considering this is not supported by every carrier). The doc block of params for the shipment is a more appropriate place for these to live.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The Go and C# examples use APIs unavailable in the repository’s pinned SDK versions and therefore cannot compile.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds USPS Claims line-item values to shipment creation examples across supported SDKs and cURL.
Changes:
- Adds
total_line_valueanditem_descriptionfields. - Covers both inline and ID-based creation where applicable.
| File | Description |
|---|---|
official/docs/ruby/current/shipments/create.rb |
Adds line items to Ruby example. |
official/docs/python/current/shipments/create.py |
Adds line items to both Python flows. |
official/docs/php/current/shipments/create.php |
Adds line items to PHP example. |
official/docs/node/current/shipments/create.js |
Adds line items to both Node.js flows. |
official/docs/java/current/shipments/create.java |
Constructs and submits Java line items. |
official/docs/golang/current/shipments/create.go |
Adds typed Go line items. |
official/docs/curl/current/shipments/create.sh |
Adds line items to the JSON payload. |
official/docs/csharp/current/shipments/create.cs |
Adds line items to both C# flows. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| LineItems = new List<EasyPost.Parameters.ILineItemParameter> | ||
| { | ||
| new EasyPost.Models.API.LineItem { TotalLineValue = "129.00", ItemDescription = "Mugs" }, |
There was a problem hiding this comment.
Fixed. examples.csproj now references EasyPost-Official 7.5.0, which has shipment line items.
| CustomsInfo: &easypost.CustomsInfo{ | ||
| ID: "cstinfo_...", | ||
| }, | ||
| LineItems: []*easypost.LineItem{ |
There was a problem hiding this comment.
Fixed. go.mod now requires easypost-go v5.6.0, which has Shipment.LineItems.
The Create a Shipment example sets LineItems. That field is on the Go client starting in v5.6.0. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts: # go.mod # go.sum
Justin Hammond (Justintime50)
left a comment
There was a problem hiding this comment.
Before this goes live, I'd ask that you please confirm these are all already available in the libs. If not, we'll want to fix that before documenting.
Product value comes from line_items. The customs id stub made the sample look like both are required.
|
Justin Hammond (@Justintime50) Confirmed, in reply to #237 (review).
No client release is needed before documenting this. |

Documents
line_itemson Create a Shipment so product value can be sent when the label is bought.https://simplerpostage.atlassian.net/browse/INSR-159
The same snippet renders on the USPS Claims Guide: