|
1 | 1 | package example |
2 | 2 |
|
3 | 3 | import ( |
4 | | - "fmt" |
| 4 | + "fmt" |
5 | 5 |
|
6 | | - "github.com/EasyPost/easypost-go/v5" |
| 6 | + "github.com/EasyPost/easypost-go/v5" |
7 | 7 | ) |
8 | 8 |
|
9 | 9 | func oneCallBuy() { |
10 | | - client := easypost.New("EASYPOST_API_KEY") |
| 10 | + client := easypost.New("EASYPOST_API_KEY") |
11 | 11 |
|
12 | | - lumaRequest := &easypost.LumaRequest{ |
13 | | - Shipment: easypost.Shipment{ |
14 | | - CarrierAccountIDs: []string{"ca_..."}, |
15 | | - Service: "NextDayAir", |
16 | | - Parcel: &easypost.Parcel{ |
17 | | - Length: 20.2, |
18 | | - Width: 10.9, |
19 | | - Height: 5, |
20 | | - Weight: 65.9, |
21 | | - }, |
22 | | - ToAddress: &easypost.Address{ |
23 | | - Name: "Dr. Steve Brule", |
24 | | - Street1: "179 N Harbor Dr", |
25 | | - City: "Redondo Beach", |
26 | | - State: "CA", |
27 | | - Zip: "90277", |
28 | | - Country: "US", |
29 | | - Phone: "4155559999", |
30 | | - Email: "dr_steve_brule@gmail.com", |
31 | | - }, |
32 | | - FromAddress: &easypost.Address{ |
33 | | - Name: "EasyPost", |
34 | | - Street1: "417 Montgomery Street", |
35 | | - Street2: "5th Floor", |
36 | | - City: "San Francisco", |
37 | | - State: "CA", |
38 | | - Zip: "90277", |
39 | | - Country: "US", |
40 | | - Phone: "4155559999", |
41 | | - Email: "support@easypost.com", |
42 | | - }, |
43 | | - Reference: "ShipmentRef", |
44 | | - }, |
45 | | - RulesetName: "ruleset_...", |
46 | | - PlannedShipDate: "2025-07-21", |
47 | | - DeliverByDate: "2025-07-25", |
48 | | - PersistLabel: false, |
49 | | - } |
| 12 | + lumaRequest := &easypost.LumaRequest{ |
| 13 | + Shipment: easypost.Shipment{ |
| 14 | + Parcel: &easypost.Parcel{ |
| 15 | + Length: 20.2, |
| 16 | + Width: 10.9, |
| 17 | + Height: 5, |
| 18 | + Weight: 65.9, |
| 19 | + }, |
| 20 | + ToAddress: &easypost.Address{ |
| 21 | + Name: "Dr. Steve Brule", |
| 22 | + Street1: "179 N Harbor Dr", |
| 23 | + City: "Redondo Beach", |
| 24 | + State: "CA", |
| 25 | + Zip: "90277", |
| 26 | + Country: "US", |
| 27 | + Phone: "4155559999", |
| 28 | + Email: "dr_steve_brule@gmail.com", |
| 29 | + }, |
| 30 | + FromAddress: &easypost.Address{ |
| 31 | + Name: "EasyPost", |
| 32 | + Street1: "417 Montgomery Street", |
| 33 | + Street2: "5th Floor", |
| 34 | + City: "San Francisco", |
| 35 | + State: "CA", |
| 36 | + Zip: "90277", |
| 37 | + Country: "US", |
| 38 | + Phone: "4155559999", |
| 39 | + Email: "support@easypost.com", |
| 40 | + }, |
| 41 | + }, |
| 42 | + RulesetName: "ruleset_...", |
| 43 | + PlannedShipDate: "2025-07-21", |
| 44 | + DeliverByDate: "2025-07-25", |
| 45 | + PersistLabel: false, |
| 46 | + } |
50 | 47 |
|
51 | | - shipment, _ := client.CreateAndBuyLumaShipment(lumaRequest) |
| 48 | + shipment, _ := client.CreateAndBuyLumaShipment(lumaRequest) |
52 | 49 |
|
53 | | - fmt.Println(shipment) |
| 50 | + fmt.Println(shipment) |
54 | 51 | } |
0 commit comments