INSR-159: Add line_items to Create a Shipment examples - #237
apeasypost wants to merge 4 commits into
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>

Summary
Create a Shipment examples used by the Getting Started guide and the Shipment API docs now include
line_items. Those values are for USPS Claims product value. They are not sent to the carrier and are not returned on the Shipment.Each item includes
total_line_valueanditem_description.Related
Made with Cursor