Skip to content

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

Merged
apeasypost merged 6 commits into
masterfrom
INSR-159-shipment-line-items
Sep 25, 2026
Merged

apeasypost merged 6 commits into
masterfrom
INSR-159-shipment-line-items

Conversation

@apeasypost

@apeasypost apeasypost commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Documents line_items on 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:

line_items on the USPS Claims Guide

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
Contributor 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
Contributor 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)

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 document the supported line-item fields and use compatible SDK dependencies.

Review effort: Balanced
Findings: 2 High severity

Open (2)

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.

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.
@apeasypost

Copy link
Copy Markdown
Contributor Author

Justin Hammond (@Justintime50) Confirmed, in reply to #237 (review). line_items is already in the libraries these samples use.

  • Go v5.10.0 (this PR): Shipment.LineItems since v5.6.0, with total_line_value and item_description.
  • C# EasyPost-Official 7.5.0 (this PR): LineItems on shipment create since 7.5.0.
  • Python (unpinned, current v10.7.0), Ruby 7.0.0, PHP 8.0.0, Node 8.5.0, and Java 8.0.0 all send the shipment create params through as a map, so line_items is included without a separate typed release.
  • cURL has no library.

No client release is needed before documenting this.

@apeasypost
apeasypost merged commit 79c602c into master Sep 25, 2026
19 checks passed
@apeasypost
apeasypost deleted the INSR-159-shipment-line-items branch September 25, 2026 23:04
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