Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b4ef0d2
Adding Luma examples
hollyabrams Jul 1, 2025
c557a26
Adding Node buy and one-call-buy examples
hollyabrams Jul 1, 2025
c912ae4
Fix: lint errors in Ruby Luma examples
hollyabrams Jul 1, 2025
46ed918
Fix: lint error in Ruby Luma example
hollyabrams Jul 1, 2025
3f5e62e
Fix: Update Go Luma examples
hollyabrams Jul 1, 2025
4f8673b
Updated Go Luma examples to match EasyPost format and supported fields
hollyabrams Jul 1, 2025
30718d1
Deleting Node Luma examples
hollyabrams Jul 1, 2025
c3d183c
Re-add and format Node Luma examples
hollyabrams Jul 1, 2025
9e067a1
Force reformat for Node Luma files
hollyabrams Jul 2, 2025
03a5e01
Add Prettier config and format Node Luma Luma examples
hollyabrams Jul 2, 2025
ed98317
Fix: Removing the .prettierrc file
hollyabrams Jul 2, 2025
c42ae8e
Updated Luma examples
hollyabrams Jul 18, 2025
71c02ca
Fix: Ruby linting errors in Luma code snippets
hollyabrams Jul 21, 2025
c286e20
Fix: Rubocop trailing commas
hollyabrams Jul 21, 2025
357e154
Fix: Update Go Luma snippets to use map-based params
hollyabrams Jul 21, 2025
68c6106
Fix: Update Luma snippets for Go 1.15 compatibility
hollyabrams Jul 21, 2025
fd7149c
Fix: Corrected Go syntax errors
hollyabrams Jul 21, 2025
19a200f
Fix: Go Luma snippets syntax errors
hollyabrams Jul 21, 2025
b68104d
Fix: Luma examples C#, Java whitespace
hollyabrams Jul 21, 2025
6f1cf3e
Refactored Luma Go snippets to align with SDK style
hollyabrams Jul 21, 2025
05f14e9
Add Go Luma examples and update go.mod/go.sum for SDK v5.2.0
hollyabrams Jul 21, 2025
7308409
Update official/docs/csharp/current/luma/buy.cs
hollyabrams Jul 23, 2025
e4afc6e
Update official/docs/curl/current/luma/promise.sh
hollyabrams Jul 23, 2025
9aca81f
Fix: Removed unnecessary parameters and standardized ruleset_name acr…
hollyabrams Jul 25, 2025
28d9a1a
Adding carrier_accounts to one-call-buy; removing persist_label
hollyabrams Jul 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ require (
github.com/EasyPost/easypost-go/v2 v2.20.0
github.com/EasyPost/easypost-go/v3 v3.2.0
github.com/EasyPost/easypost-go/v4 v4.6.0
github.com/EasyPost/easypost-go/v5 v5.0.0
github.com/EasyPost/easypost-go/v5 v5.2.0
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/EasyPost/easypost-go/v3 v3.2.0 h1:dNWmPG1AkpgYFJxhw/zGzCz1JOVXPpNIi8+
github.com/EasyPost/easypost-go/v3 v3.2.0/go.mod h1:WDD0qkjwxedVKFXCcdJBz22rtRHpuxjGazgSVcTfdIw=
github.com/EasyPost/easypost-go/v4 v4.6.0 h1:wxMK4wkGEG5vW/4Vdy3rwE9iqww1eQ1xS6oYWUZbhrc=
github.com/EasyPost/easypost-go/v4 v4.6.0/go.mod h1:WGoS4tmjHquhooMNmY6RirP+KWeYV/akcf/Jg9Q6fsk=
github.com/EasyPost/easypost-go/v5 v5.0.0 h1:w6Jp4wBD0Desgk4a1kbJpbEMexBYMz9VWPPrFeTdsak=
github.com/EasyPost/easypost-go/v5 v5.0.0/go.mod h1:wUxStg92sBzWO3m2yoFAN7CbZTr25zQeFog48itvfnw=
github.com/EasyPost/easypost-go/v5 v5.2.0 h1:UKv0AWKugaue3QGW1RvTBg6/V1Gy/QGCXVC458bcQYU=
github.com/EasyPost/easypost-go/v5 v5.2.0/go.mod h1:wUxStg92sBzWO3m2yoFAN7CbZTr25zQeFog48itvfnw=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
Expand Down
27 changes: 27 additions & 0 deletions official/docs/csharp/current/luma/buy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyPost;
using Newtonsoft.Json;

namespace EasyPostExamples
{
public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

EasyPost.Models.API.Shipment shipment = await client.Shipment.Retrieve("shp_...");

shipment = await client.Shipment.BuyLuma(
"shp_...",
rulesetName: "ruleset_...",
plannedShipDate: "2025-07-18",
deliverByDate: "2025-07-20"
);

Console.WriteLine(JsonConvert.SerializeObject(shipment, Formatting.Indented));
}
}
}
58 changes: 58 additions & 0 deletions official/docs/csharp/current/luma/one-call-buy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyPost;
using Newtonsoft.Json;

namespace EasyPostExamples
{
public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

EasyPost.Parameters.Shipment.Create parameters = new()
{
ToAddress = new EasyPost.Parameters.Address.Create
{
Name = "Dr. Steve Brule",
Street1 = "5744 Silverton Ave",
City = "McKinney",
State = "TX",
Zip = "75070",
Country = "US",
Phone = "8573875756",
Email = "dr_steve_brule@gmail.com"
},
FromAddress = new EasyPost.Parameters.Address.Create
{
Name = "EasyPost",
Street1 = "417 Montgomery Street",
Street2 = "5th Floor",
City = "San Francisco",
State = "CA",
Zip = "94104",
Country = "US",
Phone = "4153334445",
Email = "support@easypost.com"
},
Parcel = new EasyPost.Parameters.Parcel.Create
{
Length = 20.2,
Width = 10.9,
Height = 5,
Weight = 65.9
},
CarrierAccountIds = new List<string> { "ca_..." },
RulesetName = "ruleset_...",
PlannedShipDate = "2025-07-18",
DeliverByDate = "2025-07-20"
};

EasyPost.Models.API.Shipment shipment = await client.Shipment.CreateAndBuyLuma(parameters);

Console.WriteLine(JsonConvert.SerializeObject(shipment, Formatting.Indented));
}
}
}
57 changes: 57 additions & 0 deletions official/docs/csharp/current/luma/promise.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyPost;
using Newtonsoft.Json;

namespace EasyPostExamples
{
public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

EasyPost.Parameters.Luma.GetPromise parameters = new()
{
ToAddress = new EasyPost.Parameters.Address.Create
{
Name = "Dr. Steve Brule",
Street1 = "5744 Silverton Ave",
City = "McKinney",
State = "TX",
Zip = "75070",
Country = "US",
Phone = "8573875756",
Email = "dr_steve_brule@gmail.com"
},
FromAddress = new EasyPost.Parameters.Address.Create
{
Name = "EasyPost",
Street1 = "417 Montgomery Street",
Street2 = "5th Floor",
City = "San Francisco",
State = "CA",
Zip = "94104",
Country = "US",
Phone = "4153334445",
Email = "support@easypost.com"
},
Parcel = new EasyPost.Parameters.Parcel.Create
{
Length = 20.2,
Width = 10.9,
Height = 5,
Weight = 65.9
},
RulesetName = "ruleset_...",
PlannedShipDate = "2025-07-18",
DeliverByDate = "2025-07-20"
};

EasyPost.Models.API.LumaInfo lumaInfo = await client.Luma.GetPromise(parameters);

Console.WriteLine(JsonConvert.SerializeObject(lumaInfo, Formatting.Indented));
}
}
}
4 changes: 2 additions & 2 deletions official/docs/curl/current/luma/buy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ curl -X POST https://api.easypost.com/v2/shipments/shp_.../luma \
-u "EASYPOST_API_KEY": \
-H 'Content-Type: application/json' \
-d '{
"ruleset_name": "ruleset_name",
"planned_ship_date": "YYYY-MM-DD"
"ruleset_name": ""ruleset_..."",
"planned_ship_date": "YYYY-MM-DD",
"deliver_by_date": "YYYY-MM-DD"
}'
8 changes: 3 additions & 5 deletions official/docs/curl/current/luma/one-call-buy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ curl -X POST https://api.easypost.com/v2/shipments/luma \
"height": "5",
"weight": "65.9"
},
"carrier_accounts": ["ca_1", "ca_2"],
"persist_label": true,
"ruleset_name": "required_deliver_by_date",
"carrier_accounts": ["ca_..."],
"ruleset_name": "ruleset_...",
"planned_ship_date": "2025-05-14",
"deliver_by_date": "2025-05-16",
"insurance": "50.00"
"deliver_by_date": "2025-05-16"
}
}'
37 changes: 37 additions & 0 deletions official/docs/curl/current/luma/promise.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
curl -X POST 'https://api.easypost.com/v2/luma/promise' \
-u "EASYPOST_API_KEY": \
-H 'Content-Type: application/json' \
-d '{
"shipment": {
"to_address": {
"name": "Dr. Steve Brule",
"street1": "5744 Silverton Ave",
"city": "McKinney",
"state": "TX",
"zip": "75070",
"country": "US",
"phone": "8573875756",
"email": "dr_steve_brule@gmail.com"
},
"from_address": {
"name": "EasyPost",
"street1": "417 Montgomery Street",
"street2": "5th Floor",
"city": "San Francisco",
"state": "CA",
"zip": "94104",
"country": "US",
"phone": "4153334445",
"email": "support@easypost.com"
},
"parcel": {
"length": "20.2",
"width": "10.9",
"height": "5",
"weight": "65.9"
},
"ruleset_name": "ruleset_...",
"planned_ship_date": "2025-07-03",
"deliver_by_date": "2025-07-06"
}
}'
24 changes: 24 additions & 0 deletions official/docs/golang/current/luma/buy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func buy() {
client := easypost.New("EASYPOST_API_KEY")

shipment, _ := client.GetShipment("shp_...")
lumaRequest := &easypost.LumaRequest{
Shipment: easypost.Shipment{ID: shipment.ID},
RulesetName: "ruleset_...",
PlannedShipDate: "2025-07-21",
DeliverByDate: "2025-07-25",
PersistLabel: false,
}

shipment, _ = client.BuyLumaShipment(shipment.ID, lumaRequest)

fmt.Println(shipment)
}
51 changes: 51 additions & 0 deletions official/docs/golang/current/luma/one-call-buy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func oneCallBuy() {
client := easypost.New("EASYPOST_API_KEY")

lumaRequest := &easypost.LumaRequest{
Shipment: easypost.Shipment{
CarrierAccountIDs: []string{"ca_..."},
Parcel: &easypost.Parcel{
Length: 20.2,
Width: 10.9,
Height: 5,
Weight: 65.9,
},
ToAddress: &easypost.Address{
Name: "Dr. Steve Brule",
Street1: "179 N Harbor Dr",
City: "Redondo Beach",
State: "CA",
Zip: "90277",
Country: "US",
Phone: "4155559999",
Email: "dr_steve_brule@gmail.com",
},
FromAddress: &easypost.Address{
Name: "EasyPost",
Street1: "417 Montgomery Street",
Street2: "5th Floor",
City: "San Francisco",
State: "CA",
Zip: "90277",
Country: "US",
Phone: "4155559999",
Email: "support@easypost.com",
},
},
RulesetName: "ruleset_...",
PlannedShipDate: "2025-07-21",
DeliverByDate: "2025-07-25",
}

shipment, _ := client.CreateAndBuyLumaShipment(lumaRequest)

fmt.Println(shipment)
}
51 changes: 51 additions & 0 deletions official/docs/golang/current/luma/promise.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func getPromise() {
client := easypost.New("EASYPOST_API_KEY")

lumaRequest := &easypost.LumaRequest{
Shipment: easypost.Shipment{
Parcel: &easypost.Parcel{
Length: 20.2,
Width: 10.9,
Height: 5,
Weight: 65.9,
},
ToAddress: &easypost.Address{
Name: "Dr. Steve Brule",
Street1: "179 N Harbor Dr",
City: "Redondo Beach",
State: "CA",
Zip: "90277",
Country: "US",
Phone: "4155559999",
Email: "dr_steve_brule@gmail.com",
},
FromAddress: &easypost.Address{
Name: "EasyPost",
Street1: "417 Montgomery Street",
Street2: "5th Floor",
City: "San Francisco",
State: "CA",
Zip: "90277",
Country: "US",
Phone: "4155559999",
Email: "support@easypost.com",
},
},
RulesetName: "ruleset_...",
PlannedShipDate: "2025-07-21",
DeliverByDate: "2025-07-25",
PersistLabel: false,
}

lumaInfo, _ := client.GetLumaPromise(lumaRequest)

fmt.Println(lumaInfo)
}
22 changes: 22 additions & 0 deletions official/docs/java/current/luma/buy.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package luma;

import com.easypost.exception.EasyPostException;
import com.easypost.model.Shipment;
import com.easypost.service.EasyPostClient;

import java.util.HashMap;

public class BuyLuma {
public static void main(String[] args) throws EasyPostException {
EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

HashMap<String, Object> params = new HashMap<String, Object>();
params.put("ruleset_name", "ruleset_...");
params.put("planned_ship_date", "2025-07-18");
params.put("deliver_by_date", "2025-07-20");

Shipment shipment = client.shipment.luma("shp_...", params);

System.out.println(shipment);
}
}
Loading