Skip to content

INSR-159: Add line_items to Create a Shipment examples - #237

Open
apeasypost wants to merge 4 commits into
masterfrom
INSR-159-shipment-line-items
Open

apeasypost wants to merge 4 commits into
masterfrom
INSR-159-shipment-line-items

Conversation

@apeasypost

Copy link
Copy Markdown

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_value and item_description.

Related

Made with Cursor

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>
@apeasypost
apeasypost requested review from a team as code owners September 23, 2026 19:21

@Justintime50 Justin Hammond (Justintime50) left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@apeasypost
apeasypost requested a balanced review from Copilot September 23, 2026 22:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity

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_value and item_description fields.
  • 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.

Comment on lines +50 to +52
LineItems = new List<EasyPost.Parameters.ILineItemParameter>
{
new EasyPost.Models.API.LineItem { TotalLineValue = "129.00", ItemDescription = "Mugs" },

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. examples.csproj now references EasyPost-Official 7.5.0, which has shipment line items.

CustomsInfo: &easypost.CustomsInfo{
ID: "cstinfo_...",
},
LineItems: []*easypost.LineItem{

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. go.mod now requires easypost-go v5.6.0, which has Shipment.LineItems.

apeasypost and others added 2 commits September 23, 2026 22:21
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The examples consistently include valid line-item payloads, with required SDK upgrades synchronized.

Review effort: Balanced
Findings: 2 High severity

Open (2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants