File tree Expand file tree Collapse file tree
official/docs/ruby/current/luma Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
13require 'easypost'
24
3- client = EasyPost ::Client . new ( api_key : " EASYPOST_API_KEY" )
5+ client = EasyPost ::Client . new ( api_key : ' EASYPOST_API_KEY' )
46
57retrieved_shipment = client . shipment . retrieve ( 'shp_...' )
68
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
13require 'easypost'
24
3- client = EasyPost ::Client . new ( api_key : " EASYPOST_API_KEY" )
5+ client = EasyPost ::Client . new ( api_key : ' EASYPOST_API_KEY' )
46
57shipment = client . shipment . create_and_buy_luma (
68 to_address : {
1113 zip : '75070' ,
1214 country : 'US' ,
1315 phone : '8573875756' ,
14- email : 'dr_steve_brule@gmail.com' ,
16+ email : 'dr_steve_brule@gmail.com'
1517 } ,
1618 from_address : {
1719 name : 'EasyPost' ,
2224 zip : '94104' ,
2325 country : 'US' ,
2426 phone : '4153334445' ,
25- email : 'support@easypost.com' ,
27+ email : 'support@easypost.com'
2628 } ,
2729 parcel : {
2830 length : 20.2 ,
2931 width : 10.9 ,
3032 height : 5 ,
31- weight : 65.9 ,
33+ weight : 65.9
3234 } ,
3335 carrier_accounts : [ 'ca_...' ] ,
3436 persist_label : true ,
3537 ruleset_name : 'required_deliver_by_date' ,
3638 planned_ship_date : '2025-07-16' ,
3739 deliver_by_date : '2025-07-18' ,
38- insurance : '50.00' ,
40+ insurance : '50.00'
3941)
4042
4143puts shipment
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
13require 'easypost'
24
3- client = EasyPost ::Client . new ( api_key : " EASYPOST_API_KEY" )
5+ client = EasyPost ::Client . new ( api_key : ' EASYPOST_API_KEY' )
46
57shipment = client . luma . get_promise (
68 to_address : {
1113 zip : '75070' ,
1214 country : 'US' ,
1315 phone : '8573875756' ,
14- email : 'dr_steve_brule@gmail.com' ,
16+ email : 'dr_steve_brule@gmail.com'
1517 } ,
1618 from_address : {
1719 name : 'EasyPost' ,
2224 zip : '94104' ,
2325 country : 'US' ,
2426 phone : '4153334445' ,
25- email : 'support@easypost.com' ,
27+ email : 'support@easypost.com'
2628 } ,
2729 parcel : {
2830 length : 20.2 ,
2931 width : 10.9 ,
3032 height : 5 ,
31- weight : 65.9 ,
33+ weight : 65.9
3234 } ,
3335 ruleset_name : 'required_deliver_by_date' ,
3436 planned_ship_date : '2025-07-16' ,
35- deliver_by_date : '2025-07-18' ,
37+ deliver_by_date : '2025-07-18'
3638)
3739
3840puts shipment
You can’t perform that action at this time.
0 commit comments