Class: Io::Flow::V0::Clients::HarmonizedLandedCosts

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ HarmonizedLandedCosts

Returns a new instance of HarmonizedLandedCosts.



3063
3064
3065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3063

def initialize(client)
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
end

Instance Method Details

#post(organization, harmonized_landed_cost_form) ⇒ Object

Single operation that provides harmonization landed costs (i.e. duties and taxes) for 1 or more items. This method is designed to enable a single call from applications that need it (like checkout) to get all data for a collection of items



3071
3072
3073
3074
3075
3076
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3071

def post(organization, harmonized_landed_cost_form)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  (x = harmonized_landed_cost_form; x.is_a?(::Io::Flow::V0::Models::HarmonizedLandedCostForm) ? x : ::Io::Flow::V0::Models::HarmonizedLandedCostForm.new(x))
  r = @client.request("/#{CGI.escape(organization)}/harmonization/landed-costs").with_json(harmonized_landed_cost_form.to_json).post
  ::Io::Flow::V0::Models::HarmonizedLandedCost.new(r)
end