Class: EasyPost::Services::SmartRate

Inherits:
Service
  • Object
show all
Defined in:
lib/easypost/services/smart_rate.rb

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from EasyPost::Services::Service

Instance Method Details

#estimate_delivery_date(params = {}) ⇒ Object

Retrieve the estimated delivery date of each carrier-service level combination via the Smart Deliver By API, based on a specific ship date and origin-destination postal code pair.



4
5
6
7
8
9
# File 'lib/easypost/services/smart_rate.rb', line 4

def estimate_delivery_date(params = {})
  url = 'smartrate/deliver_by'

  response = @client.make_request(:post, url, params)
  EasyPost::InternalUtilities::Json.convert_json_to_object(response, EasyPost::Models::EasyPostObject)
end

#recommend_ship_date(params = {}) ⇒ Object

Retrieve a recommended ship date for each carrier-service level combination via the Smart Deliver On API, based on a specific delivery date and origin-destination postal code pair.



13
14
15
16
17
18
# File 'lib/easypost/services/smart_rate.rb', line 13

def recommend_ship_date(params = {})
  url = 'smartrate/deliver_on'

  response = @client.make_request(:post, url, params)
  EasyPost::InternalUtilities::Json.convert_json_to_object(response, EasyPost::Models::EasyPostObject)
end