class EasyPost::Services::Order
Public Instance Methods
Source
# File lib/easypost/services/order.rb, line 29 def buy(id, params = {}) if params.instance_of?(EasyPost::Models::Rate) params = { carrier: params[:carrier], service: params[:service] } end response = @client.make_request(:post, "orders/#{id}/buy", params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Buy an Order
object
Source
# File lib/easypost/services/order.rb, line 7 def create(params = {}) wrapped_params = { order: params } response = @client.make_request(:post, 'orders', wrapped_params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Create an Order
object
Source
# File lib/easypost/services/order.rb, line 22 def get_rates(id, params = {}) response = @client.make_request(:get, "orders/#{id}/rates", params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Retrieve new rates for an Order
object
Source
# File lib/easypost/services/order.rb, line 15 def retrieve(id) response = @client.make_request(:get, "orders/#{id}") EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Retrieve an Order
object