Class: HubSpotSDK::Resources::Settings::Currencies

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/settings/currencies.rb,
lib/hubspot_sdk/resources/settings/currencies/exchange_rates.rb,
lib/hubspot_sdk/resources/settings/currencies/central_fx_rates.rb,
lib/hubspot_sdk/resources/settings/currencies/exchange_rates/batch.rb

Defined Under Namespace

Classes: CentralFxRates, ExchangeRates

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Currencies

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Currencies.

Parameters:



75
76
77
78
79
# File 'lib/hubspot_sdk/resources/settings/currencies.rb', line 75

def initialize(client:)
  @client = client
  @central_fx_rates = HubSpotSDK::Resources::Settings::Currencies::CentralFxRates.new(client: client)
  @exchange_rates = HubSpotSDK::Resources::Settings::Currencies::ExchangeRates.new(client: client)
end

Instance Attribute Details

#central_fx_ratesHubSpotSDK::Resources::Settings::Currencies::CentralFxRates (readonly)



8
9
10
# File 'lib/hubspot_sdk/resources/settings/currencies.rb', line 8

def central_fx_rates
  @central_fx_rates
end

#exchange_ratesHubSpotSDK::Resources::Settings::Currencies::ExchangeRates (readonly)



11
12
13
# File 'lib/hubspot_sdk/resources/settings/currencies.rb', line 11

def exchange_rates
  @exchange_rates
end

Instance Method Details

#get_company_currency(request_options: {}) ⇒ HubSpotSDK::Models::Settings::CompanyCurrency

Get the details for the company currency. The company currency is used in deal totals, reports, and the default currency for new deals.

Parameters:

Returns:

See Also:



23
24
25
26
27
28
29
30
# File 'lib/hubspot_sdk/resources/settings/currencies.rb', line 23

def get_company_currency(params = {})
  @client.request(
    method: :get,
    path: "settings/currencies/2026-03/company-currency",
    model: HubSpotSDK::Settings::CompanyCurrency,
    options: params[:request_options]
  )
end

#list_codes(request_options: {}) ⇒ HubSpotSDK::Models::Settings::CollectionResponseCurrencyCodeInfoNoPaging

Retrieve a list of all available currency codes and their names.



41
42
43
44
45
46
47
48
# File 'lib/hubspot_sdk/resources/settings/currencies.rb', line 41

def list_codes(params = {})
  @client.request(
    method: :get,
    path: "settings/currencies/2026-03/codes",
    model: HubSpotSDK::Settings::CollectionResponseCurrencyCodeInfoNoPaging,
    options: params[:request_options]
  )
end

#update_company_currency(currency_code:, request_options: {}) ⇒ HubSpotSDK::Models::Settings::CompanyCurrency

Set or update the primary company currency.

Parameters:

Returns:

See Also:



61
62
63
64
65
66
67
68
69
70
# File 'lib/hubspot_sdk/resources/settings/currencies.rb', line 61

def update_company_currency(params)
  parsed, options = HubSpotSDK::Settings::CurrencyUpdateCompanyCurrencyParams.dump_request(params)
  @client.request(
    method: :put,
    path: "settings/currencies/2026-03/company-currency",
    body: parsed,
    model: HubSpotSDK::Settings::CompanyCurrency,
    options: options
  )
end