From 9ead807ab1c6ac9ceabb9257a5331577edd8fb69 Mon Sep 17 00:00:00 2001 From: jchen293 Date: Mon, 15 Jul 2024 16:20:22 -0400 Subject: [PATCH 1/6] Add SmartRate functions code snippets for all seven client libs --- .../smartrate/retrieve-recommend-ship-date.cs | 27 +++ ...etrieve-standalone-smartrate-deliver-by.cs | 30 +++ ...etrieve-standalone-smartrate-deliver-on.cs | 30 +++ .../smartrate/retrieve-recommend-ship-date.sh | 2 + ...etrieve-standalone-smartrate-deliver-by.sh | 9 + ...etrieve-standalone-smartrate-deliver-on.sh | 9 + .../golang/current/carrier-accounts/create.go | 9 + .../golang/current/carrier-accounts/update.go | 8 + .../smartrate/retrieve-recommend-ship-date.go | 15 ++ ...etrieve-standalone-smartrate-deliver-by.go | 22 ++ ...etrieve-standalone-smartrate-deliver-on.go | 22 ++ .../retrieve-recommend-ship-date.java | 20 ++ ...rieve-standalone-smartrate-deliver-by.java | 27 +++ ...rieve-standalone-smartrate-deliver-on.java | 27 +++ .../smartrate/retrieve-recommend-ship-date.js | 12 ++ ...etrieve-standalone-smartrate-deliver-by.js | 16 ++ ...etrieve-standalone-smartrate-deliver-on.js | 16 ++ .../retrieve-recommend-ship-date.php | 7 + ...trieve-standalone-smartrate-deliver-by.php | 14 ++ ...trieve-standalone-smartrate-deliver-on.php | 14 ++ .../smartrate/retrieve-recommend-ship-date.py | 10 + ...etrieve-standalone-smartrate-deliver-by.py | 14 ++ ...etrieve-standalone-smartrate-deliver-on.py | 14 ++ ...martrate-retrieve-recommend-ship-date.json | 194 ++++++++++++++++++ ...rieve-standalone-smartrate-deliver-by.json | 89 ++++++++ ...rieve-standalone-smartrate-deliver-on.json | 99 +++++++++ .../smartrate/retrieve-recommend-ship-date.rb | 10 + ...etrieve-standalone-smartrate-deliver-by.rb | 14 ++ ...etrieve-standalone-smartrate-deliver-on.rb | 14 ++ 29 files changed, 794 insertions(+) create mode 100644 official/docs/csharp/current/smartrate/retrieve-recommend-ship-date.cs create mode 100644 official/docs/csharp/current/smartrate/retrieve-standalone-smartrate-deliver-by.cs create mode 100644 official/docs/csharp/current/smartrate/retrieve-standalone-smartrate-deliver-on.cs create mode 100644 official/docs/curl/current/smartrate/retrieve-recommend-ship-date.sh create mode 100644 official/docs/curl/current/smartrate/retrieve-standalone-smartrate-deliver-by.sh create mode 100644 official/docs/curl/current/smartrate/retrieve-standalone-smartrate-deliver-on.sh create mode 100644 official/docs/golang/current/smartrate/retrieve-recommend-ship-date.go create mode 100644 official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-by.go create mode 100644 official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-on.go create mode 100644 official/docs/java/current/smartrate/retrieve-recommend-ship-date.java create mode 100644 official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-by.java create mode 100644 official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-on.java create mode 100644 official/docs/node/current/smartrate/retrieve-recommend-ship-date.js create mode 100644 official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js create mode 100644 official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js create mode 100644 official/docs/php/current/smartrate/retrieve-recommend-ship-date.php create mode 100644 official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-by.php create mode 100644 official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-on.php create mode 100644 official/docs/python/current/smartrate/retrieve-recommend-ship-date.py create mode 100644 official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-by.py create mode 100644 official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-on.py create mode 100644 official/docs/responses/smartrate/smartrate-retrieve-recommend-ship-date.json create mode 100644 official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-by.json create mode 100644 official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-on.json create mode 100644 official/docs/ruby/current/smartrate/retrieve-recommend-ship-date.rb create mode 100644 official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb create mode 100644 official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb diff --git a/official/docs/csharp/current/smartrate/retrieve-recommend-ship-date.cs b/official/docs/csharp/current/smartrate/retrieve-recommend-ship-date.cs new file mode 100644 index 00000000..384618b5 --- /dev/null +++ b/official/docs/csharp/current/smartrate/retrieve-recommend-ship-date.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Newtonsoft.Json; +using EasyPost; +using EasyPost.Models.API; +using EasyPost.Parameters; + +namespace EasyPostExamples +{ + public class Examples + { + public static async Task Main() + { + var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY")); + + Parameters.Shipment.RecommendShipDateForShipment parameters = new() + { + DesiredDeliveryDate = "2024-07-18", + }; + + List rates = await client.Shipment.RetrieveEstimatedDeliveryDate("shp_...", parameters); + + Console.WriteLine(JsonConvert.SerializeObject(rates, Formatting.Indented)); + } + } +} diff --git a/official/docs/csharp/current/smartrate/retrieve-standalone-smartrate-deliver-by.cs b/official/docs/csharp/current/smartrate/retrieve-standalone-smartrate-deliver-by.cs new file mode 100644 index 00000000..11af1b57 --- /dev/null +++ b/official/docs/csharp/current/smartrate/retrieve-standalone-smartrate-deliver-by.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Newtonsoft.Json; +using EasyPost; +using EasyPost.Models.API; +using EasyPost.Parameters; + +namespace EasyPostExamples +{ + public class Examples + { + public static async Task Main() + { + var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY")); + + Parameters.SmartRate.EstimateDeliveryDateForZipPair estimateDeliveryDateForZipPairParameters = new() + { + OriginPostalCode = address1Parameters.Zip, + DestinationPostalCode = address2Parameters.Zip, + PlannedShipDate = Fixtures.PlannedShipDate, + Carriers = ["USPS"], + }; + + EstimateDeliveryDateForZipPairResult results = await client.SmartRate.EstimateDeliveryDate(estimateDeliveryDateForZipPairParameters); + + Console.WriteLine(JsonConvert.SerializeObject(results, Formatting.Indented)); + } + } +} diff --git a/official/docs/csharp/current/smartrate/retrieve-standalone-smartrate-deliver-on.cs b/official/docs/csharp/current/smartrate/retrieve-standalone-smartrate-deliver-on.cs new file mode 100644 index 00000000..1f0f6942 --- /dev/null +++ b/official/docs/csharp/current/smartrate/retrieve-standalone-smartrate-deliver-on.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Newtonsoft.Json; +using EasyPost; +using EasyPost.Models.API; +using EasyPost.Parameters; + +namespace EasyPostExamples +{ + public class Examples + { + public static async Task Main() + { + var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY")); + + Parameters.SmartRate.RecommendShipDateForZipPair recommendShipDateForZipPairParameters = new() + { + OriginPostalCode = address1Parameters.Zip, + DestinationPostalCode = address2Parameters.Zip, + DesiredDeliveryDate = Fixtures.DesiredDeliveryDate, + Carriers = ["USPS"], + }; + + RecommendShipDateForZipPairResult results = await client.SmartRate.RecommendShipDate(recommendShipDateForZipPairParameters); + + Console.WriteLine(JsonConvert.SerializeObject(results, Formatting.Indented)); + } + } +} diff --git a/official/docs/curl/current/smartrate/retrieve-recommend-ship-date.sh b/official/docs/curl/current/smartrate/retrieve-recommend-ship-date.sh new file mode 100644 index 00000000..cdbc9e54 --- /dev/null +++ b/official/docs/curl/current/smartrate/retrieve-recommend-ship-date.sh @@ -0,0 +1,2 @@ +curl -X GET https://api.easypost.com/v2/shipments/shp_.../smartrate/precision_shipping?desired_delivery_date=yyyy-mm-dd \ + -u "EASYPOST_API_KEY": diff --git a/official/docs/curl/current/smartrate/retrieve-standalone-smartrate-deliver-by.sh b/official/docs/curl/current/smartrate/retrieve-standalone-smartrate-deliver-by.sh new file mode 100644 index 00000000..48fbc9eb --- /dev/null +++ b/official/docs/curl/current/smartrate/retrieve-standalone-smartrate-deliver-by.sh @@ -0,0 +1,9 @@ +curl -X POST https://api.easypost.com/v2/smartrate/deliver_by \ + -u "EASYPOST_API_KEY": \ + -H 'Content-Type: application/json' \ + -d '{ + "from_zip": "10001", + "planned_ship_date": "2024-07-18", + "to_zip": "10002", + "carriers": [UPS], + }' diff --git a/official/docs/curl/current/smartrate/retrieve-standalone-smartrate-deliver-on.sh b/official/docs/curl/current/smartrate/retrieve-standalone-smartrate-deliver-on.sh new file mode 100644 index 00000000..26f5ed14 --- /dev/null +++ b/official/docs/curl/current/smartrate/retrieve-standalone-smartrate-deliver-on.sh @@ -0,0 +1,9 @@ +curl -X POST https://api.easypost.com/v2/smartrate/deliver_on \ + -u "EASYPOST_API_KEY": \ + -H 'Content-Type: application/json' \ + -d '{ + "from_zip": "10001", + "desired_delivery_date": "2024-07-18", + "to_zip": "10002", + "carriers": [UPS], + }' diff --git a/official/docs/golang/current/carrier-accounts/create.go b/official/docs/golang/current/carrier-accounts/create.go index dd513b53..84bc0e77 100644 --- a/official/docs/golang/current/carrier-accounts/create.go +++ b/official/docs/golang/current/carrier-accounts/create.go @@ -28,5 +28,14 @@ func main() { }, ) + // For UPS account creation, please use below method instead + + createUpsParameters := &easypost.UpsCarrierAccountCreationParameters{ + AccountNumber: "123456789", + Type: "UpsAccount", + } + + carrierAccount, err := client.CreateUpsCarrierAccount(createUpsParameters) + fmt.Println(carrierAccount) } diff --git a/official/docs/golang/current/carrier-accounts/update.go b/official/docs/golang/current/carrier-accounts/update.go index ac741683..dc699a03 100644 --- a/official/docs/golang/current/carrier-accounts/update.go +++ b/official/docs/golang/current/carrier-accounts/update.go @@ -19,5 +19,13 @@ func main() { }, ) + // For UPS account update, please use below method instead + + updateParameters := &easypost.UpsCarrierAccountUpdateParameters{ + AccountNumber: "987654321", + } + + carrierAccount, err := client.UpdateUpsCarrierAccount(carrierAccount.ID, updateParameters) + fmt.Println(carrierAccount) } diff --git a/official/docs/golang/current/smartrate/retrieve-recommend-ship-date.go b/official/docs/golang/current/smartrate/retrieve-recommend-ship-date.go new file mode 100644 index 00000000..15b033ca --- /dev/null +++ b/official/docs/golang/current/smartrate/retrieve-recommend-ship-date.go @@ -0,0 +1,15 @@ +package example + +import ( + "fmt" + + "github.com/EasyPost/easypost-go/v4" +) + +func main() { + client := easypost.New("EASYPOST_API_KEY") + + rates, _ := client.RecommendShipDateForShipment("shp_...", "YYYY-MM-DD") + + fmt.Println(rates) +} diff --git a/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-by.go b/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-by.go new file mode 100644 index 00000000..792a99ad --- /dev/null +++ b/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-by.go @@ -0,0 +1,22 @@ +package example + +import ( + "fmt" + + "github.com/EasyPost/easypost-go/v4" +) + +func main() { + client := easypost.New("EASYPOST_API_KEY") + + params := &easypost.EstimateDeliveryDateForZipPairParams{ + OriginPostalCode: "10001", + DestinationPostalCode: "10002", + Carriers: []string{"UPS", "FedEx"}, + PlannedShipDate: "2024-07-18", + } + + estimates, _ := client.EstimateDeliveryDateForZipPair(params) + + fmt.Println(estimates) +} diff --git a/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-on.go b/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-on.go new file mode 100644 index 00000000..16200b7f --- /dev/null +++ b/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-on.go @@ -0,0 +1,22 @@ +package example + +import ( + "fmt" + + "github.com/EasyPost/easypost-go/v4" +) + +func main() { + client := easypost.New("EASYPOST_API_KEY") + + params := &easypost.RecommendShipDateForZipPairParams{ + OriginPostalCode: "10001", + DestinationPostalCode: "10002", + Carriers: []string{"UPS", "FedEx"}, + DesiredDeliveryDate: "2024-07-18", + } + + recommendations, _ := client.RecommendShipDateForZipPair(params) + + fmt.Println(recommendations) +} diff --git a/official/docs/java/current/smartrate/retrieve-recommend-ship-date.java b/official/docs/java/current/smartrate/retrieve-recommend-ship-date.java new file mode 100644 index 00000000..0ff2ccb2 --- /dev/null +++ b/official/docs/java/current/smartrate/retrieve-recommend-ship-date.java @@ -0,0 +1,20 @@ +package shipments; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.Shipment; +import com.easypost.model.RecommendShipDateForShipmentResult; +import com.easypost.service.EasyPostClient; + +import java.util.List; + +public class RetrieveRecommendShipDate { + public static void main(String[] args) throws EasyPostException { + EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY"); + + Shipment shipment = client.shipment.retrieve("shp_..."); + List rates = client.shipment + .recommendShipDate(shipment.getId(), "YYYY-MM-DD"); + + System.out.println(rates); + } +} diff --git a/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-by.java b/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-by.java new file mode 100644 index 00000000..990c343b --- /dev/null +++ b/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-by.java @@ -0,0 +1,27 @@ +package shipments; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.Shipment; +import com.easypost.model.EstimateDeliveryDateForZipPairResult; +import com.easypost.service.EasyPostClient; + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RetrieveRecommendShipDate { + public static void main(String[] args) throws EasyPostException { + EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY"); + Map params = new HashMap(); + params.put("from_zip", "10001"); + params.put("to_zip", "10002"); + params.put("planned_ship_date", "2024-07-18"); + params.put("carriers", Collections.singletonList("UPS")); + + EstimateDeliveryDateForZipPairResult results = client.smartRate + .estimateDeliveryDate(params); + + System.out.println(results); + } +} diff --git a/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-on.java b/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-on.java new file mode 100644 index 00000000..122935bc --- /dev/null +++ b/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-on.java @@ -0,0 +1,27 @@ +package shipments; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.Shipment; +import com.easypost.model.RecommendShipDateForZipPairResult; +import com.easypost.service.EasyPostClient; + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RetrieveRecommendShipDate { + public static void main(String[] args) throws EasyPostException { + EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY"); + Map params = new HashMap(); + params.put("from_zip", "10001"); + params.put("to_zip", "10002"); + params.put("desired_delivery_date", "2024-07-18"); + params.put("carriers", Collections.singletonList("UPS")); + + RecommendShipDateForZipPairResult results = client.smartRate + .recommendShipDate(params); + + System.out.println(results); + } +} diff --git a/official/docs/node/current/smartrate/retrieve-recommend-ship-date.js b/official/docs/node/current/smartrate/retrieve-recommend-ship-date.js new file mode 100644 index 00000000..fa49eb43 --- /dev/null +++ b/official/docs/node/current/smartrate/retrieve-recommend-ship-date.js @@ -0,0 +1,12 @@ +const EasyPostClient = require('@easypost/api'); + +const client = new EasyPostClient('EASYPOST_API_KEY'); + +(async () => { + const rates = await client.Shipment.recommendShipDate( + 'shp_...', + 'YYYY-MM-DD', + ); + + console.log(rates); +})(); diff --git a/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js new file mode 100644 index 00000000..0f686e54 --- /dev/null +++ b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js @@ -0,0 +1,16 @@ +const EasyPostClient = require('@easypost/api'); + +const client = new EasyPostClient('EASYPOST_API_KEY'); + +const params = { + from_zip: "10001", + to_zip: "10002", + planned_ship_date: "2024-07-18", + carriers: ["UPS"], + }; + +(async () => { + const results = await this.client.SmartRate.estimateDeliveryDate(params); + + console.log(results); +})(); diff --git a/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js new file mode 100644 index 00000000..29d3f7bc --- /dev/null +++ b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js @@ -0,0 +1,16 @@ +const EasyPostClient = require('@easypost/api'); + +const client = new EasyPostClient('EASYPOST_API_KEY'); + +const params = { + from_zip: "10001", + to_zip: "10002", + desired_delivery_date: "2024-07-18", + carriers: ["UPS"], + }; + +(async () => { + const results = await this.client.SmartRate.recommendShipDate(params); + + console.log(results); +})(); diff --git a/official/docs/php/current/smartrate/retrieve-recommend-ship-date.php b/official/docs/php/current/smartrate/retrieve-recommend-ship-date.php new file mode 100644 index 00000000..a6d02b7d --- /dev/null +++ b/official/docs/php/current/smartrate/retrieve-recommend-ship-date.php @@ -0,0 +1,7 @@ +shipment->recommendShipDate('shp_...', 'YYYY-MM-DD'); + +echo $rates; diff --git a/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-by.php b/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-by.php new file mode 100644 index 00000000..d5b3744d --- /dev/null +++ b/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-by.php @@ -0,0 +1,14 @@ + "10001", + 'to_zip' => "10002", + 'planned_ship_date' => "2024-07-18", + 'carriers' => ["UPS"], +]; + +$results = $client->smartRate->estimateDeliveryDate($params); + +echo $results; diff --git a/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-on.php b/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-on.php new file mode 100644 index 00000000..9643cfc4 --- /dev/null +++ b/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-on.php @@ -0,0 +1,14 @@ + "10001", + 'to_zip' => "10002", + 'desired_delivery_date' => "2024-07-18", + 'carriers' => ["UPS"], +]; + +$results = $client->smartRate->recommendShipDate($params); + +echo $results; diff --git a/official/docs/python/current/smartrate/retrieve-recommend-ship-date.py b/official/docs/python/current/smartrate/retrieve-recommend-ship-date.py new file mode 100644 index 00000000..cd58670a --- /dev/null +++ b/official/docs/python/current/smartrate/retrieve-recommend-ship-date.py @@ -0,0 +1,10 @@ +import easypost + +client = easypost.EasyPostClient("EASYPOST_API_KEY") + +estimated_delivery_dates = client.shipment.recommend_ship_date( + "shp_...", + desired_delivery_date="YYYY-MM-DD", +) + +print(estimated_delivery_dates) diff --git a/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-by.py b/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-by.py new file mode 100644 index 00000000..5bde2151 --- /dev/null +++ b/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-by.py @@ -0,0 +1,14 @@ +import easypost + +client = easypost.EasyPostClient("EASYPOST_API_KEY") + +params = { + "from_zip": "10001", + "to_zip": "10002", + "planned_ship_date": "2024-07-18", + "carriers": ["usps"], +} + +results = client.smartrate.estimate_delivery_date(**params) + +print(results) diff --git a/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-on.py b/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-on.py new file mode 100644 index 00000000..16b01249 --- /dev/null +++ b/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-on.py @@ -0,0 +1,14 @@ +import easypost + +client = easypost.EasyPostClient("EASYPOST_API_KEY") + +params = { + "from_zip": "10001", + "to_zip": "10002", + "desired_delivery_date": "2024-07-18", + "carriers": ["usps"], +} + +results = client.smartrate.recommend_ship_date(**params) + +print(results) diff --git a/official/docs/responses/smartrate/smartrate-retrieve-recommend-ship-date.json b/official/docs/responses/smartrate/smartrate-retrieve-recommend-ship-date.json new file mode 100644 index 00000000..9bf7d6da --- /dev/null +++ b/official/docs/responses/smartrate/smartrate-retrieve-recommend-ship-date.json @@ -0,0 +1,194 @@ +{ + "rates":[ + { + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":3, + "percentile_85":4, + "percentile_90":4, + "percentile_95":5, + "percentile_97":5, + "percentile_99":7 + }, + "delivery_date_confidence":0.19, + "desired_delivery_date":"2024-07-16", + "estimated_transit_days":3, + "ship_on_date":"2024-07-13" + }, + "rate":{ + "carrier":"USPS", + "carrier_account_id":"ca_716f33fd9fd348238b85c2922237f98b", + "created_at":"2024-07-11T18:55:42Z", + "currency":"USD", + "delivery_date":null, + "delivery_date_guaranteed":false, + "delivery_days":2, + "est_delivery_days":2, + "id":"rate_bdfda26163de43878a65e0f456b30ddb", + "list_currency":"USD", + "list_rate":8.25, + "mode":"test", + "object":"Rate", + "rate":6.9, + "retail_currency":"USD", + "retail_rate":9.8, + "service":"Priority", + "shipment_id":"shp_3d7216c496144494acf875f0a9555272", + "updated_at":"2024-07-11T18:55:42Z" + } + }, + { + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":3, + "percentile_85":4, + "percentile_90":4, + "percentile_95":5, + "percentile_97":5, + "percentile_99":9 + }, + "delivery_date_confidence":0.21, + "desired_delivery_date":"2024-07-16", + "estimated_transit_days":3, + "ship_on_date":"2024-07-13" + }, + "rate":{ + "carrier":"USPS", + "carrier_account_id":"ca_716f33fd9fd348238b85c2922237f98b", + "created_at":"2024-07-11T18:55:42Z", + "currency":"USD", + "delivery_date":null, + "delivery_date_guaranteed":false, + "delivery_days":3, + "est_delivery_days":3, + "id":"rate_475a7a2b833e401abe78bb26e3fda731", + "list_currency":"USD", + "list_rate":6.4, + "mode":"test", + "object":"Rate", + "rate":5.93, + "retail_currency":"USD", + "retail_rate":8.45, + "service":"GroundAdvantage", + "shipment_id":"shp_3d7216c496144494acf875f0a9555272", + "updated_at":"2024-07-11T18:55:42Z" + } + }, + { + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":3, + "percentile_85":4, + "percentile_90":4, + "percentile_95":5, + "percentile_97":5, + "percentile_99":9 + }, + "delivery_date_confidence":0.21, + "desired_delivery_date":"2024-07-16", + "estimated_transit_days":3, + "ship_on_date":"2024-07-13" + }, + "rate":{ + "carrier":"USPS", + "carrier_account_id":"ca_716f33fd9fd348238b85c2922237f98b", + "created_at":"2024-07-11T18:55:42Z", + "currency":"USD", + "delivery_date":null, + "delivery_date_guaranteed":false, + "delivery_days":3, + "est_delivery_days":3, + "id":"rate_253b47e9de5f4159ab4d1509adaf83cb", + "list_currency":"USD", + "list_rate":6.4, + "mode":"test", + "object":"Rate", + "rate":5.93, + "retail_currency":"USD", + "retail_rate":8.45, + "service":"First", + "shipment_id":"shp_3d7216c496144494acf875f0a9555272", + "updated_at":"2024-07-11T18:55:42Z" + } + }, + { + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":3, + "percentile_85":4, + "percentile_90":4, + "percentile_95":5, + "percentile_97":5, + "percentile_99":9 + }, + "delivery_date_confidence":0.21, + "desired_delivery_date":"2024-07-16", + "estimated_transit_days":3, + "ship_on_date":"2024-07-13" + }, + "rate":{ + "carrier":"USPS", + "carrier_account_id":"ca_716f33fd9fd348238b85c2922237f98b", + "created_at":"2024-07-11T18:55:42Z", + "currency":"USD", + "delivery_date":null, + "delivery_date_guaranteed":false, + "delivery_days":3, + "est_delivery_days":3, + "id":"rate_565d5a7580f54504af994b65f969ac1b", + "list_currency":"USD", + "list_rate":6.4, + "mode":"test", + "object":"Rate", + "rate":5.93, + "retail_currency":"USD", + "retail_rate":8.45, + "service":"ParcelSelect", + "shipment_id":"shp_3d7216c496144494acf875f0a9555272", + "updated_at":"2024-07-11T18:55:42Z" + } + }, + { + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":2, + "percentile_85":2, + "percentile_90":3, + "percentile_95":3, + "percentile_97":4, + "percentile_99":7 + }, + "delivery_date_confidence":0.47, + "desired_delivery_date":"2024-07-16", + "estimated_transit_days":1, + "ship_on_date":"2024-07-15" + }, + "rate":{ + "carrier":"USPS", + "carrier_account_id":"ca_716f33fd9fd348238b85c2922237f98b", + "created_at":"2024-07-11T18:55:42Z", + "currency":"USD", + "delivery_date":null, + "delivery_date_guaranteed":false, + "delivery_days":2, + "est_delivery_days":2, + "id":"rate_33de2fbd3f5340eebebb47338723a631", + "list_currency":"USD", + "list_rate":33.1, + "mode":"test", + "object":"Rate", + "rate":33.1, + "retail_currency":"USD", + "retail_rate":37.9, + "service":"Express", + "shipment_id":"shp_3d7216c496144494acf875f0a9555272", + "updated_at":"2024-07-11T18:55:42Z" + } + } + ] +} diff --git a/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-by.json b/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-by.json new file mode 100644 index 00000000..c203c919 --- /dev/null +++ b/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-by.json @@ -0,0 +1,89 @@ +{ + "carriers_without_tint_estimates":null, + "from_zip":"94107", + "planned_ship_date":"2024-07-16", + "results":[ + { + "carrier":"USPS", + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":1, + "percentile_75":2, + "percentile_85":2, + "percentile_90":3, + "percentile_95":3, + "percentile_97":4, + "percentile_99":6 + }, + "easypost_estimated_delivery_date":"2024-07-17" + }, + "service":"express" + }, + { + "carrier":"USPS", + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":3, + "percentile_85":3, + "percentile_90":4, + "percentile_95":6, + "percentile_97":6, + "percentile_99":9 + }, + "easypost_estimated_delivery_date":"2024-07-18" + }, + "service":"groundadvantage" + }, + { + "carrier":"USPS", + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":3, + "percentile_75":3, + "percentile_85":3, + "percentile_90":6, + "percentile_95":6, + "percentile_97":6, + "percentile_99":9 + }, + "easypost_estimated_delivery_date":"2024-07-18" + }, + "service":"librarymail" + }, + { + "carrier":"USPS", + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":3, + "percentile_75":3, + "percentile_85":3, + "percentile_90":4, + "percentile_95":6, + "percentile_97":6, + "percentile_99":9 + }, + "easypost_estimated_delivery_date":"2024-07-18" + }, + "service":"mediamail" + }, + { + "carrier":"USPS", + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":3, + "percentile_85":3, + "percentile_90":3, + "percentile_95":4, + "percentile_97":6, + "percentile_99":7 + }, + "easypost_estimated_delivery_date":"2024-07-18" + }, + "service":"priority" + } + ], + "saturday_delivery":null, + "to_zip":"90277" +} diff --git a/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-on.json b/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-on.json new file mode 100644 index 00000000..1d4dca0e --- /dev/null +++ b/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-on.json @@ -0,0 +1,99 @@ +{ + "carriers_without_tint_estimates":null, + "desired_delivery_date":"2024-07-16", + "from_zip":"94107", + "results":[ + { + "carrier":"USPS", + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":2, + "percentile_85":2, + "percentile_90":3, + "percentile_95":3, + "percentile_97":4, + "percentile_99":7 + }, + "delivery_date_confidence":0.47, + "estimated_transit_days":1, + "ship_on_date":"2024-07-15" + }, + "service":"express" + }, + { + "carrier":"USPS", + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":3, + "percentile_85":4, + "percentile_90":4, + "percentile_95":5, + "percentile_97":5, + "percentile_99":9 + }, + "delivery_date_confidence":0.21, + "estimated_transit_days":3, + "ship_on_date":"2024-07-13" + }, + "service":"groundadvantage" + }, + { + "carrier":"USPS", + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":3, + "percentile_85":4, + "percentile_90":4, + "percentile_95":5, + "percentile_97":6, + "percentile_99":9 + }, + "delivery_date_confidence":0.25, + "estimated_transit_days":3, + "ship_on_date":"2024-07-13" + }, + "service":"librarymail" + }, + { + "carrier":"USPS", + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":3, + "percentile_85":3, + "percentile_90":4, + "percentile_95":5, + "percentile_97":5, + "percentile_99":7 + }, + "delivery_date_confidence":0.24, + "estimated_transit_days":3, + "ship_on_date":"2024-07-13" + }, + "service":"mediamail" + }, + { + "carrier":"USPS", + "easypost_time_in_transit_data":{ + "days_in_transit":{ + "percentile_50":2, + "percentile_75":3, + "percentile_85":4, + "percentile_90":4, + "percentile_95":5, + "percentile_97":5, + "percentile_99":7 + }, + "delivery_date_confidence":0.19, + "estimated_transit_days":3, + "ship_on_date":"2024-07-13" + }, + "service":"priority" + } + ], + "saturday_delivery":null, + "to_zip":"90277" +} diff --git a/official/docs/ruby/current/smartrate/retrieve-recommend-ship-date.rb b/official/docs/ruby/current/smartrate/retrieve-recommend-ship-date.rb new file mode 100644 index 00000000..4b5022e2 --- /dev/null +++ b/official/docs/ruby/current/smartrate/retrieve-recommend-ship-date.rb @@ -0,0 +1,10 @@ +require 'easypost' + +client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY') + +rates = client.shipment.recommend_ship_date( + 'shp_...', + 'YYYY-MM-DD', +) + +puts rates diff --git a/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb new file mode 100644 index 00000000..d0dad2b7 --- /dev/null +++ b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb @@ -0,0 +1,14 @@ +require 'easypost' + +client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY') + +params = { + from_zip: "10001", + to_zip: "10002", + planned_ship_date: "2024-07-18", + carriers: ["ups"], + } + +results = client.smart_rate.estimate_delivery_date(params) + +puts results diff --git a/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb new file mode 100644 index 00000000..e6050287 --- /dev/null +++ b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb @@ -0,0 +1,14 @@ +require 'easypost' + +client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY') + +params = { + from_zip: "10001", + to_zip: "10002", + desired_delivery_date: "2024-07-18", + carriers: ["ups"], + } + +results = client.smart_rate.recommend_ship_date(params) + +puts results From 48d0df4028f816b3d85164f6f56007cfa7b0b217 Mon Sep 17 00:00:00 2001 From: jchen293 Date: Mon, 15 Jul 2024 16:26:15 -0400 Subject: [PATCH 2/6] lint --- .../retrieve-standalone-smartrate-deliver-by.java | 2 -- .../retrieve-standalone-smartrate-deliver-on.java | 2 -- .../smartrate/retrieve-standalone-smartrate-deliver-by.js | 2 +- .../smartrate/retrieve-standalone-smartrate-deliver-on.js | 2 +- .../retrieve-standalone-smartrate-deliver-by.php | 8 ++++---- .../retrieve-standalone-smartrate-deliver-on.php | 8 ++++---- .../smartrate/retrieve-standalone-smartrate-deliver-by.rb | 8 ++++---- .../smartrate/retrieve-standalone-smartrate-deliver-on.rb | 8 ++++---- 8 files changed, 18 insertions(+), 22 deletions(-) diff --git a/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-by.java b/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-by.java index 990c343b..75b704d2 100644 --- a/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-by.java +++ b/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-by.java @@ -1,13 +1,11 @@ package shipments; import com.easypost.exception.EasyPostException; -import com.easypost.model.Shipment; import com.easypost.model.EstimateDeliveryDateForZipPairResult; import com.easypost.service.EasyPostClient; import java.util.Collections; import java.util.HashMap; -import java.util.List; import java.util.Map; public class RetrieveRecommendShipDate { diff --git a/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-on.java b/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-on.java index 122935bc..3b9a6367 100644 --- a/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-on.java +++ b/official/docs/java/current/smartrate/retrieve-standalone-smartrate-deliver-on.java @@ -1,13 +1,11 @@ package shipments; import com.easypost.exception.EasyPostException; -import com.easypost.model.Shipment; import com.easypost.model.RecommendShipDateForZipPairResult; import com.easypost.service.EasyPostClient; import java.util.Collections; import java.util.HashMap; -import java.util.List; import java.util.Map; public class RetrieveRecommendShipDate { diff --git a/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js index 0f686e54..c372827f 100644 --- a/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js +++ b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js @@ -10,7 +10,7 @@ const params = { }; (async () => { - const results = await this.client.SmartRate.estimateDeliveryDate(params); + const results = await client.SmartRate.estimateDeliveryDate(params); console.log(results); })(); diff --git a/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js index 29d3f7bc..878b8d5d 100644 --- a/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js +++ b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js @@ -10,7 +10,7 @@ const params = { }; (async () => { - const results = await this.client.SmartRate.recommendShipDate(params); + const results = await client.SmartRate.recommendShipDate(params); console.log(results); })(); diff --git a/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-by.php b/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-by.php index d5b3744d..91bf0e15 100644 --- a/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-by.php +++ b/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-by.php @@ -3,10 +3,10 @@ $client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY'); $params = [ - 'from_zip' => "10001", - 'to_zip' => "10002", - 'planned_ship_date' => "2024-07-18", - 'carriers' => ["UPS"], + 'from_zip' => '10001', + 'to_zip' => '10002', + 'planned_ship_date' => '2024-07-18', + 'carriers' => ['UPS'], ]; $results = $client->smartRate->estimateDeliveryDate($params); diff --git a/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-on.php b/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-on.php index 9643cfc4..7b3c9f37 100644 --- a/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-on.php +++ b/official/docs/php/current/smartrate/retrieve-standalone-smartrate-deliver-on.php @@ -3,10 +3,10 @@ $client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY'); $params = [ - 'from_zip' => "10001", - 'to_zip' => "10002", - 'desired_delivery_date' => "2024-07-18", - 'carriers' => ["UPS"], + 'from_zip' => '10001', + 'to_zip' => '10002', + 'desired_delivery_date' => '2024-07-18', + 'carriers' => ['UPS'], ]; $results = $client->smartRate->recommendShipDate($params); diff --git a/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb index d0dad2b7..825da5f1 100644 --- a/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb +++ b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb @@ -3,10 +3,10 @@ client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY') params = { - from_zip: "10001", - to_zip: "10002", - planned_ship_date: "2024-07-18", - carriers: ["ups"], + from_zip: '10001', + to_zip: '10002', + planned_ship_date: '2024-07-18', + carriers: ['ups'], } results = client.smart_rate.estimate_delivery_date(params) diff --git a/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb index e6050287..de243f53 100644 --- a/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb +++ b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb @@ -3,10 +3,10 @@ client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY') params = { - from_zip: "10001", - to_zip: "10002", - desired_delivery_date: "2024-07-18", - carriers: ["ups"], + from_zip: '10001', + to_zip: '10002', + desired_delivery_date: '2024-07-18', + carriers: ['ups'], } results = client.smart_rate.recommend_ship_date(params) From d88ce340dc7913283e32df1db570b8e32eeba2b1 Mon Sep 17 00:00:00 2001 From: jchen293 Date: Mon, 15 Jul 2024 16:34:20 -0400 Subject: [PATCH 3/6] fix lint for node --- ...etrieve-standalone-smartrate-deliver-by.js | 10 +- ...etrieve-standalone-smartrate-deliver-on.js | 10 +- ...martrate-retrieve-recommend-ship-date.json | 372 +++++++++--------- ...rieve-standalone-smartrate-deliver-by.json | 162 ++++---- ...rieve-standalone-smartrate-deliver-on.json | 182 ++++----- 5 files changed, 368 insertions(+), 368 deletions(-) diff --git a/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js index c372827f..5d826547 100644 --- a/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js +++ b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-by.js @@ -3,11 +3,11 @@ const EasyPostClient = require('@easypost/api'); const client = new EasyPostClient('EASYPOST_API_KEY'); const params = { - from_zip: "10001", - to_zip: "10002", - planned_ship_date: "2024-07-18", - carriers: ["UPS"], - }; + from_zip: '10001', + to_zip: '10002', + planned_ship_date: '2024-07-18', + carriers: ['UPS'], +}; (async () => { const results = await client.SmartRate.estimateDeliveryDate(params); diff --git a/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js index 878b8d5d..cd0e5fb3 100644 --- a/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js +++ b/official/docs/node/current/smartrate/retrieve-standalone-smartrate-deliver-on.js @@ -3,11 +3,11 @@ const EasyPostClient = require('@easypost/api'); const client = new EasyPostClient('EASYPOST_API_KEY'); const params = { - from_zip: "10001", - to_zip: "10002", - desired_delivery_date: "2024-07-18", - carriers: ["UPS"], - }; + from_zip: '10001', + to_zip: '10002', + desired_delivery_date: '2024-07-18', + carriers: ['UPS'], +}; (async () => { const results = await client.SmartRate.recommendShipDate(params); diff --git a/official/docs/responses/smartrate/smartrate-retrieve-recommend-ship-date.json b/official/docs/responses/smartrate/smartrate-retrieve-recommend-ship-date.json index 9bf7d6da..a8dbf37b 100644 --- a/official/docs/responses/smartrate/smartrate-retrieve-recommend-ship-date.json +++ b/official/docs/responses/smartrate/smartrate-retrieve-recommend-ship-date.json @@ -1,194 +1,194 @@ { - "rates":[ - { - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":3, - "percentile_85":4, - "percentile_90":4, - "percentile_95":5, - "percentile_97":5, - "percentile_99":7 - }, - "delivery_date_confidence":0.19, - "desired_delivery_date":"2024-07-16", - "estimated_transit_days":3, - "ship_on_date":"2024-07-13" + "rates": [ + { + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 3, + "percentile_85": 4, + "percentile_90": 4, + "percentile_95": 5, + "percentile_97": 5, + "percentile_99": 7 }, - "rate":{ - "carrier":"USPS", - "carrier_account_id":"ca_716f33fd9fd348238b85c2922237f98b", - "created_at":"2024-07-11T18:55:42Z", - "currency":"USD", - "delivery_date":null, - "delivery_date_guaranteed":false, - "delivery_days":2, - "est_delivery_days":2, - "id":"rate_bdfda26163de43878a65e0f456b30ddb", - "list_currency":"USD", - "list_rate":8.25, - "mode":"test", - "object":"Rate", - "rate":6.9, - "retail_currency":"USD", - "retail_rate":9.8, - "service":"Priority", - "shipment_id":"shp_3d7216c496144494acf875f0a9555272", - "updated_at":"2024-07-11T18:55:42Z" - } - }, - { - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":3, - "percentile_85":4, - "percentile_90":4, - "percentile_95":5, - "percentile_97":5, - "percentile_99":9 - }, - "delivery_date_confidence":0.21, - "desired_delivery_date":"2024-07-16", - "estimated_transit_days":3, - "ship_on_date":"2024-07-13" + "delivery_date_confidence": 0.19, + "desired_delivery_date": "2024-07-16", + "estimated_transit_days": 3, + "ship_on_date": "2024-07-13" + }, + "rate": { + "carrier": "USPS", + "carrier_account_id": "ca_716f33fd9fd348238b85c2922237f98b", + "created_at": "2024-07-11T18:55:42Z", + "currency": "USD", + "delivery_date": null, + "delivery_date_guaranteed": false, + "delivery_days": 2, + "est_delivery_days": 2, + "id": "rate_bdfda26163de43878a65e0f456b30ddb", + "list_currency": "USD", + "list_rate": 8.25, + "mode": "test", + "object": "Rate", + "rate": 6.9, + "retail_currency": "USD", + "retail_rate": 9.8, + "service": "Priority", + "shipment_id": "shp_3d7216c496144494acf875f0a9555272", + "updated_at": "2024-07-11T18:55:42Z" + } + }, + { + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 3, + "percentile_85": 4, + "percentile_90": 4, + "percentile_95": 5, + "percentile_97": 5, + "percentile_99": 9 }, - "rate":{ - "carrier":"USPS", - "carrier_account_id":"ca_716f33fd9fd348238b85c2922237f98b", - "created_at":"2024-07-11T18:55:42Z", - "currency":"USD", - "delivery_date":null, - "delivery_date_guaranteed":false, - "delivery_days":3, - "est_delivery_days":3, - "id":"rate_475a7a2b833e401abe78bb26e3fda731", - "list_currency":"USD", - "list_rate":6.4, - "mode":"test", - "object":"Rate", - "rate":5.93, - "retail_currency":"USD", - "retail_rate":8.45, - "service":"GroundAdvantage", - "shipment_id":"shp_3d7216c496144494acf875f0a9555272", - "updated_at":"2024-07-11T18:55:42Z" - } - }, - { - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":3, - "percentile_85":4, - "percentile_90":4, - "percentile_95":5, - "percentile_97":5, - "percentile_99":9 - }, - "delivery_date_confidence":0.21, - "desired_delivery_date":"2024-07-16", - "estimated_transit_days":3, - "ship_on_date":"2024-07-13" + "delivery_date_confidence": 0.21, + "desired_delivery_date": "2024-07-16", + "estimated_transit_days": 3, + "ship_on_date": "2024-07-13" + }, + "rate": { + "carrier": "USPS", + "carrier_account_id": "ca_716f33fd9fd348238b85c2922237f98b", + "created_at": "2024-07-11T18:55:42Z", + "currency": "USD", + "delivery_date": null, + "delivery_date_guaranteed": false, + "delivery_days": 3, + "est_delivery_days": 3, + "id": "rate_475a7a2b833e401abe78bb26e3fda731", + "list_currency": "USD", + "list_rate": 6.4, + "mode": "test", + "object": "Rate", + "rate": 5.93, + "retail_currency": "USD", + "retail_rate": 8.45, + "service": "GroundAdvantage", + "shipment_id": "shp_3d7216c496144494acf875f0a9555272", + "updated_at": "2024-07-11T18:55:42Z" + } + }, + { + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 3, + "percentile_85": 4, + "percentile_90": 4, + "percentile_95": 5, + "percentile_97": 5, + "percentile_99": 9 }, - "rate":{ - "carrier":"USPS", - "carrier_account_id":"ca_716f33fd9fd348238b85c2922237f98b", - "created_at":"2024-07-11T18:55:42Z", - "currency":"USD", - "delivery_date":null, - "delivery_date_guaranteed":false, - "delivery_days":3, - "est_delivery_days":3, - "id":"rate_253b47e9de5f4159ab4d1509adaf83cb", - "list_currency":"USD", - "list_rate":6.4, - "mode":"test", - "object":"Rate", - "rate":5.93, - "retail_currency":"USD", - "retail_rate":8.45, - "service":"First", - "shipment_id":"shp_3d7216c496144494acf875f0a9555272", - "updated_at":"2024-07-11T18:55:42Z" - } - }, - { - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":3, - "percentile_85":4, - "percentile_90":4, - "percentile_95":5, - "percentile_97":5, - "percentile_99":9 - }, - "delivery_date_confidence":0.21, - "desired_delivery_date":"2024-07-16", - "estimated_transit_days":3, - "ship_on_date":"2024-07-13" + "delivery_date_confidence": 0.21, + "desired_delivery_date": "2024-07-16", + "estimated_transit_days": 3, + "ship_on_date": "2024-07-13" + }, + "rate": { + "carrier": "USPS", + "carrier_account_id": "ca_716f33fd9fd348238b85c2922237f98b", + "created_at": "2024-07-11T18:55:42Z", + "currency": "USD", + "delivery_date": null, + "delivery_date_guaranteed": false, + "delivery_days": 3, + "est_delivery_days": 3, + "id": "rate_253b47e9de5f4159ab4d1509adaf83cb", + "list_currency": "USD", + "list_rate": 6.4, + "mode": "test", + "object": "Rate", + "rate": 5.93, + "retail_currency": "USD", + "retail_rate": 8.45, + "service": "First", + "shipment_id": "shp_3d7216c496144494acf875f0a9555272", + "updated_at": "2024-07-11T18:55:42Z" + } + }, + { + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 3, + "percentile_85": 4, + "percentile_90": 4, + "percentile_95": 5, + "percentile_97": 5, + "percentile_99": 9 }, - "rate":{ - "carrier":"USPS", - "carrier_account_id":"ca_716f33fd9fd348238b85c2922237f98b", - "created_at":"2024-07-11T18:55:42Z", - "currency":"USD", - "delivery_date":null, - "delivery_date_guaranteed":false, - "delivery_days":3, - "est_delivery_days":3, - "id":"rate_565d5a7580f54504af994b65f969ac1b", - "list_currency":"USD", - "list_rate":6.4, - "mode":"test", - "object":"Rate", - "rate":5.93, - "retail_currency":"USD", - "retail_rate":8.45, - "service":"ParcelSelect", - "shipment_id":"shp_3d7216c496144494acf875f0a9555272", - "updated_at":"2024-07-11T18:55:42Z" - } - }, - { - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":2, - "percentile_85":2, - "percentile_90":3, - "percentile_95":3, - "percentile_97":4, - "percentile_99":7 - }, - "delivery_date_confidence":0.47, - "desired_delivery_date":"2024-07-16", - "estimated_transit_days":1, - "ship_on_date":"2024-07-15" + "delivery_date_confidence": 0.21, + "desired_delivery_date": "2024-07-16", + "estimated_transit_days": 3, + "ship_on_date": "2024-07-13" + }, + "rate": { + "carrier": "USPS", + "carrier_account_id": "ca_716f33fd9fd348238b85c2922237f98b", + "created_at": "2024-07-11T18:55:42Z", + "currency": "USD", + "delivery_date": null, + "delivery_date_guaranteed": false, + "delivery_days": 3, + "est_delivery_days": 3, + "id": "rate_565d5a7580f54504af994b65f969ac1b", + "list_currency": "USD", + "list_rate": 6.4, + "mode": "test", + "object": "Rate", + "rate": 5.93, + "retail_currency": "USD", + "retail_rate": 8.45, + "service": "ParcelSelect", + "shipment_id": "shp_3d7216c496144494acf875f0a9555272", + "updated_at": "2024-07-11T18:55:42Z" + } + }, + { + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 2, + "percentile_85": 2, + "percentile_90": 3, + "percentile_95": 3, + "percentile_97": 4, + "percentile_99": 7 }, - "rate":{ - "carrier":"USPS", - "carrier_account_id":"ca_716f33fd9fd348238b85c2922237f98b", - "created_at":"2024-07-11T18:55:42Z", - "currency":"USD", - "delivery_date":null, - "delivery_date_guaranteed":false, - "delivery_days":2, - "est_delivery_days":2, - "id":"rate_33de2fbd3f5340eebebb47338723a631", - "list_currency":"USD", - "list_rate":33.1, - "mode":"test", - "object":"Rate", - "rate":33.1, - "retail_currency":"USD", - "retail_rate":37.9, - "service":"Express", - "shipment_id":"shp_3d7216c496144494acf875f0a9555272", - "updated_at":"2024-07-11T18:55:42Z" - } - } + "delivery_date_confidence": 0.47, + "desired_delivery_date": "2024-07-16", + "estimated_transit_days": 1, + "ship_on_date": "2024-07-15" + }, + "rate": { + "carrier": "USPS", + "carrier_account_id": "ca_716f33fd9fd348238b85c2922237f98b", + "created_at": "2024-07-11T18:55:42Z", + "currency": "USD", + "delivery_date": null, + "delivery_date_guaranteed": false, + "delivery_days": 2, + "est_delivery_days": 2, + "id": "rate_33de2fbd3f5340eebebb47338723a631", + "list_currency": "USD", + "list_rate": 33.1, + "mode": "test", + "object": "Rate", + "rate": 33.1, + "retail_currency": "USD", + "retail_rate": 37.9, + "service": "Express", + "shipment_id": "shp_3d7216c496144494acf875f0a9555272", + "updated_at": "2024-07-11T18:55:42Z" + } + } ] } diff --git a/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-by.json b/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-by.json index c203c919..58a8bb63 100644 --- a/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-by.json +++ b/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-by.json @@ -1,89 +1,89 @@ { - "carriers_without_tint_estimates":null, - "from_zip":"94107", - "planned_ship_date":"2024-07-16", - "results":[ - { - "carrier":"USPS", - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":1, - "percentile_75":2, - "percentile_85":2, - "percentile_90":3, - "percentile_95":3, - "percentile_97":4, - "percentile_99":6 - }, - "easypost_estimated_delivery_date":"2024-07-17" + "carriers_without_tint_estimates": null, + "from_zip": "94107", + "planned_ship_date": "2024-07-16", + "results": [ + { + "carrier": "USPS", + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 1, + "percentile_75": 2, + "percentile_85": 2, + "percentile_90": 3, + "percentile_95": 3, + "percentile_97": 4, + "percentile_99": 6 }, - "service":"express" - }, - { - "carrier":"USPS", - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":3, - "percentile_85":3, - "percentile_90":4, - "percentile_95":6, - "percentile_97":6, - "percentile_99":9 - }, - "easypost_estimated_delivery_date":"2024-07-18" + "easypost_estimated_delivery_date": "2024-07-17" + }, + "service": "express" + }, + { + "carrier": "USPS", + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 3, + "percentile_85": 3, + "percentile_90": 4, + "percentile_95": 6, + "percentile_97": 6, + "percentile_99": 9 }, - "service":"groundadvantage" - }, - { - "carrier":"USPS", - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":3, - "percentile_75":3, - "percentile_85":3, - "percentile_90":6, - "percentile_95":6, - "percentile_97":6, - "percentile_99":9 - }, - "easypost_estimated_delivery_date":"2024-07-18" + "easypost_estimated_delivery_date": "2024-07-18" + }, + "service": "groundadvantage" + }, + { + "carrier": "USPS", + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 3, + "percentile_75": 3, + "percentile_85": 3, + "percentile_90": 6, + "percentile_95": 6, + "percentile_97": 6, + "percentile_99": 9 }, - "service":"librarymail" - }, - { - "carrier":"USPS", - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":3, - "percentile_75":3, - "percentile_85":3, - "percentile_90":4, - "percentile_95":6, - "percentile_97":6, - "percentile_99":9 - }, - "easypost_estimated_delivery_date":"2024-07-18" + "easypost_estimated_delivery_date": "2024-07-18" + }, + "service": "librarymail" + }, + { + "carrier": "USPS", + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 3, + "percentile_75": 3, + "percentile_85": 3, + "percentile_90": 4, + "percentile_95": 6, + "percentile_97": 6, + "percentile_99": 9 }, - "service":"mediamail" - }, - { - "carrier":"USPS", - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":3, - "percentile_85":3, - "percentile_90":3, - "percentile_95":4, - "percentile_97":6, - "percentile_99":7 - }, - "easypost_estimated_delivery_date":"2024-07-18" + "easypost_estimated_delivery_date": "2024-07-18" + }, + "service": "mediamail" + }, + { + "carrier": "USPS", + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 3, + "percentile_85": 3, + "percentile_90": 3, + "percentile_95": 4, + "percentile_97": 6, + "percentile_99": 7 }, - "service":"priority" - } + "easypost_estimated_delivery_date": "2024-07-18" + }, + "service": "priority" + } ], - "saturday_delivery":null, - "to_zip":"90277" + "saturday_delivery": null, + "to_zip": "90277" } diff --git a/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-on.json b/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-on.json index 1d4dca0e..414f03f8 100644 --- a/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-on.json +++ b/official/docs/responses/smartrate/standalone-smartrate-retrieve-standalone-smartrate-deliver-on.json @@ -1,99 +1,99 @@ { - "carriers_without_tint_estimates":null, - "desired_delivery_date":"2024-07-16", - "from_zip":"94107", - "results":[ - { - "carrier":"USPS", - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":2, - "percentile_85":2, - "percentile_90":3, - "percentile_95":3, - "percentile_97":4, - "percentile_99":7 - }, - "delivery_date_confidence":0.47, - "estimated_transit_days":1, - "ship_on_date":"2024-07-15" + "carriers_without_tint_estimates": null, + "desired_delivery_date": "2024-07-16", + "from_zip": "94107", + "results": [ + { + "carrier": "USPS", + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 2, + "percentile_85": 2, + "percentile_90": 3, + "percentile_95": 3, + "percentile_97": 4, + "percentile_99": 7 }, - "service":"express" - }, - { - "carrier":"USPS", - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":3, - "percentile_85":4, - "percentile_90":4, - "percentile_95":5, - "percentile_97":5, - "percentile_99":9 - }, - "delivery_date_confidence":0.21, - "estimated_transit_days":3, - "ship_on_date":"2024-07-13" + "delivery_date_confidence": 0.47, + "estimated_transit_days": 1, + "ship_on_date": "2024-07-15" + }, + "service": "express" + }, + { + "carrier": "USPS", + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 3, + "percentile_85": 4, + "percentile_90": 4, + "percentile_95": 5, + "percentile_97": 5, + "percentile_99": 9 }, - "service":"groundadvantage" - }, - { - "carrier":"USPS", - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":3, - "percentile_85":4, - "percentile_90":4, - "percentile_95":5, - "percentile_97":6, - "percentile_99":9 - }, - "delivery_date_confidence":0.25, - "estimated_transit_days":3, - "ship_on_date":"2024-07-13" + "delivery_date_confidence": 0.21, + "estimated_transit_days": 3, + "ship_on_date": "2024-07-13" + }, + "service": "groundadvantage" + }, + { + "carrier": "USPS", + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 3, + "percentile_85": 4, + "percentile_90": 4, + "percentile_95": 5, + "percentile_97": 6, + "percentile_99": 9 }, - "service":"librarymail" - }, - { - "carrier":"USPS", - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":3, - "percentile_85":3, - "percentile_90":4, - "percentile_95":5, - "percentile_97":5, - "percentile_99":7 - }, - "delivery_date_confidence":0.24, - "estimated_transit_days":3, - "ship_on_date":"2024-07-13" + "delivery_date_confidence": 0.25, + "estimated_transit_days": 3, + "ship_on_date": "2024-07-13" + }, + "service": "librarymail" + }, + { + "carrier": "USPS", + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 3, + "percentile_85": 3, + "percentile_90": 4, + "percentile_95": 5, + "percentile_97": 5, + "percentile_99": 7 }, - "service":"mediamail" - }, - { - "carrier":"USPS", - "easypost_time_in_transit_data":{ - "days_in_transit":{ - "percentile_50":2, - "percentile_75":3, - "percentile_85":4, - "percentile_90":4, - "percentile_95":5, - "percentile_97":5, - "percentile_99":7 - }, - "delivery_date_confidence":0.19, - "estimated_transit_days":3, - "ship_on_date":"2024-07-13" + "delivery_date_confidence": 0.24, + "estimated_transit_days": 3, + "ship_on_date": "2024-07-13" + }, + "service": "mediamail" + }, + { + "carrier": "USPS", + "easypost_time_in_transit_data": { + "days_in_transit": { + "percentile_50": 2, + "percentile_75": 3, + "percentile_85": 4, + "percentile_90": 4, + "percentile_95": 5, + "percentile_97": 5, + "percentile_99": 7 }, - "service":"priority" - } + "delivery_date_confidence": 0.19, + "estimated_transit_days": 3, + "ship_on_date": "2024-07-13" + }, + "service": "priority" + } ], - "saturday_delivery":null, - "to_zip":"90277" + "saturday_delivery": null, + "to_zip": "90277" } From 095c2665fcf7c39281109ae8b65e7c194f52c919 Mon Sep 17 00:00:00 2001 From: jchen293 Date: Mon, 15 Jul 2024 16:37:10 -0400 Subject: [PATCH 4/6] lint --- .../current/smartrate/retrieve-recommend-ship-date.js | 8 ++++---- .../retrieve-standalone-smartrate-deliver-by.rb | 10 +++++----- .../retrieve-standalone-smartrate-deliver-on.rb | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/official/docs/node/current/smartrate/retrieve-recommend-ship-date.js b/official/docs/node/current/smartrate/retrieve-recommend-ship-date.js index fa49eb43..5a4c618f 100644 --- a/official/docs/node/current/smartrate/retrieve-recommend-ship-date.js +++ b/official/docs/node/current/smartrate/retrieve-recommend-ship-date.js @@ -1,11 +1,11 @@ -const EasyPostClient = require('@easypost/api'); +const EasyPostClient = require("@easypost/api"); -const client = new EasyPostClient('EASYPOST_API_KEY'); +const client = new EasyPostClient("EASYPOST_API_KEY"); (async () => { const rates = await client.Shipment.recommendShipDate( - 'shp_...', - 'YYYY-MM-DD', + "shp_...", + "YYYY-MM-DD" ); console.log(rates); diff --git a/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb index 825da5f1..e8cabad0 100644 --- a/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb +++ b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-by.rb @@ -3,11 +3,11 @@ client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY') params = { - from_zip: '10001', - to_zip: '10002', - planned_ship_date: '2024-07-18', - carriers: ['ups'], - } + from_zip: '10001', + to_zip: '10002', + planned_ship_date: '2024-07-18', + carriers: ['ups'], +} results = client.smart_rate.estimate_delivery_date(params) diff --git a/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb index de243f53..3f6a3945 100644 --- a/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb +++ b/official/docs/ruby/current/smartrate/retrieve-standalone-smartrate-deliver-on.rb @@ -3,11 +3,11 @@ client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY') params = { - from_zip: '10001', - to_zip: '10002', - desired_delivery_date: '2024-07-18', - carriers: ['ups'], - } + from_zip: '10001', + to_zip: '10002', + desired_delivery_date: '2024-07-18', + carriers: ['ups'], +} results = client.smart_rate.recommend_ship_date(params) From c62e23544bddf651e120fa487eeece457ec5785f Mon Sep 17 00:00:00 2001 From: jchen293 Date: Mon, 15 Jul 2024 16:39:27 -0400 Subject: [PATCH 5/6] lint --- .../current/smartrate/retrieve-recommend-ship-date.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/official/docs/node/current/smartrate/retrieve-recommend-ship-date.js b/official/docs/node/current/smartrate/retrieve-recommend-ship-date.js index 5a4c618f..8fb8f7f4 100644 --- a/official/docs/node/current/smartrate/retrieve-recommend-ship-date.js +++ b/official/docs/node/current/smartrate/retrieve-recommend-ship-date.js @@ -1,12 +1,9 @@ -const EasyPostClient = require("@easypost/api"); +const EasyPostClient = require('@easypost/api'); -const client = new EasyPostClient("EASYPOST_API_KEY"); +const client = new EasyPostClient('EASYPOST_API_KEY'); (async () => { - const rates = await client.Shipment.recommendShipDate( - "shp_...", - "YYYY-MM-DD" - ); + const rates = await client.Shipment.recommendShipDate('shp_...', 'YYYY-MM-DD'); console.log(rates); })(); From 6196a67f50fad0415610d7e3c1f3be1d5b87fb5b Mon Sep 17 00:00:00 2001 From: jchen293 Date: Mon, 15 Jul 2024 16:55:06 -0400 Subject: [PATCH 6/6] address feedback --- .../csharp/current/smartrate/retrieve-recommend-ship-date.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/official/docs/csharp/current/smartrate/retrieve-recommend-ship-date.cs b/official/docs/csharp/current/smartrate/retrieve-recommend-ship-date.cs index 384618b5..45a96c98 100644 --- a/official/docs/csharp/current/smartrate/retrieve-recommend-ship-date.cs +++ b/official/docs/csharp/current/smartrate/retrieve-recommend-ship-date.cs @@ -19,7 +19,7 @@ public static async Task Main() DesiredDeliveryDate = "2024-07-18", }; - List rates = await client.Shipment.RetrieveEstimatedDeliveryDate("shp_...", parameters); + List rates = await client.Shipment.RecommendShipDate("shp_...", parameters); Console.WriteLine(JsonConvert.SerializeObject(rates, Formatting.Indented)); }