diff --git a/examples.csproj b/examples.csproj index 010bfc84..4f32aaeb 100644 --- a/examples.csproj +++ b/examples.csproj @@ -12,7 +12,7 @@ - + diff --git a/official/docs/csharp/current/shipments/create.cs b/official/docs/csharp/current/shipments/create.cs index 22d54dec..5ea6f2a1 100644 --- a/official/docs/csharp/current/shipments/create.cs +++ b/official/docs/csharp/current/shipments/create.cs @@ -43,9 +43,10 @@ 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" }, + new EasyPost.Models.API.LineItem { TotalLineValue = "45.50", ItemDescription = "T-shirts" }, } }; @@ -53,19 +54,22 @@ 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" }, + 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..92cdc17c 100755 --- a/official/docs/curl/current/shipments/create.sh +++ b/official/docs/curl/current/shipments/create.sh @@ -30,8 +30,15 @@ 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", + "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..ae09b9ad 100644 --- a/official/docs/golang/current/shipments/create.go +++ b/official/docs/golang/current/shipments/create.go @@ -38,8 +38,15 @@ func create() { Height: 5, Weight: 65.9, }, - 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..ed4c123f 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 { @@ -37,14 +39,23 @@ 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"); + + 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..88cf168e 100644 --- a/official/docs/node/current/shipments/create.js +++ b/official/docs/node/current/shipments/create.js @@ -32,7 +32,10 @@ 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' }, + ], }); // or create by using IDs @@ -41,7 +44,10 @@ 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' }, + ], }); 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..7d1d0d9e 100644 --- a/official/docs/python/current/shipments/create.py +++ b/official/docs/python/current/shipments/create.py @@ -30,7 +30,10 @@ "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"}, + ], ) # or create by using IDs @@ -39,7 +42,10 @@ 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"}, + ], ) print(shipment) diff --git a/official/docs/ruby/current/shipments/create.rb b/official/docs/ruby/current/shipments/create.rb index c22548f8..39b35b71 100644 --- a/official/docs/ruby/current/shipments/create.rb +++ b/official/docs/ruby/current/shipments/create.rb @@ -30,9 +30,16 @@ 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', + }, + ], ) puts shipment