Module: EasyshipRatesRubyApi::Api::Rates

Included in:
Client
Defined in:
lib/easyship/rates/ruby/api/api/rates.rb

Overview

Rate API

[(contribute here)](github.com/easyship/easyship-rates-ruby-api)

See Also:

Instance Method Summary collapse

Instance Method Details

#get_all_rates(options = {}) ⇒ Easyship::Rates::Ruby::Mash

Retrieve all detailed Rate

Options Hash (options):

  • :origin_country_id (String)
  • :destination_country_id (String)
  • :is_insured (String)
  • :items (Array<Hash>)


39
40
41
42
43
# File 'lib/easyship/rates/ruby/api/api/rates.rb', line 39

def get_all_rates(options = {})
  path = '/get_all_rates'
  defaults = {}
  Mash.from_json(post(path, defaults.merge(options)).body)
end

#get_base_price(options = {}) ⇒ Easyship::Rates::Ruby::Mash

Retrieve a Base Price

Options Hash (options):

  • :courier_id (String)

    courier_id

  • :destination_country_id (String)

    destination_country_id

  • :total_actual_weight (String)

    total_actual_weight



52
53
54
55
# File 'lib/easyship/rates/ruby/api/api/rates.rb', line 52

def get_base_price(options = {})
  path = '/get_base_price'
  simple_query(path, options)
end

#get_efulfillment_rates(options = {}) ⇒ Object



67
68
69
70
71
# File 'lib/easyship/rates/ruby/api/api/rates.rb', line 67

def get_efulfillment_rates(options = {})
  path = '/get_efulfillment_rates'
  defaults = {}
  Mash.from_json(post(path, defaults.merge(options)).body)
end

#get_rate(options = {}) ⇒ Easyship::Rates::Ruby::Mash

Retrieve a Rate

Options Hash (options):

  • :length (String)

    length

  • :width (String)

    width

  • :height (String)

    height

  • :origin_country_id (String)

    origin_country_id

  • :destination_country_id (String)

    destination_country_id

  • :total_actual_weight (String)

    total_actual_weight



19
20
21
22
# File 'lib/easyship/rates/ruby/api/api/rates.rb', line 19

def get_rate(options = {})
  path = '/get_rates'
  simple_query(path, options)
end

#update_rates(options = {}) ⇒ Easyship::Rates::Ruby::Mash

Update Rate by courier admin name

Options Hash (options):

  • :admin_name (String)


61
62
63
64
65
# File 'lib/easyship/rates/ruby/api/api/rates.rb', line 61

def update_rates(options = {})
  path = '/update_rates'
  defaults = {}
  Mash.from_json(post(path, defaults.merge(options)).body)
end