Class: MetronomeSDK::Resources::V1::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/metronome_sdk/resources/v1/settings.rb,
lib/metronome_sdk/resources/v1/settings/billing_providers.rb

Overview

Use these endpoints to configure a billing API key, a webhook secret, or invoice finalization behavior.

Defined Under Namespace

Classes: BillingProviders

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Settings

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 Settings.

Parameters:



54
55
56
57
# File 'lib/metronome_sdk/resources/v1/settings.rb', line 54

def initialize(client:)
  @client = client
  @billing_providers = MetronomeSDK::Resources::V1::Settings::BillingProviders.new(client: client)
end

Instance Attribute Details

#billing_providersMetronomeSDK::Resources::V1::Settings::BillingProviders (readonly)

Use these endpoints to configure a billing API key, a webhook secret, or invoice finalization behavior.



12
13
14
# File 'lib/metronome_sdk/resources/v1/settings.rb', line 12

def billing_providers
  @billing_providers
end

Instance Method Details

#upsert_avalara_credentials(avalara_environment:, avalara_password:, avalara_username:, delivery_method_ids:, commit_transactions: nil, request_options: {}) ⇒ MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsResponse

Some parameter documentations has been truncated, see Models::V1::SettingUpsertAvalaraCredentialsParams for more details.

Set the Avalara credentials for some specified ‘delivery_method_ids`, which can be found in the `/listConfiguredBillingProviders` response. This maps the Avalara credentials to the appropriate billing entity. These credentials are only used for PLG Invoicing today.

Parameters:

  • avalara_environment (Symbol, MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsParams::AvalaraEnvironment)

    The Avalara environment to use (SANDBOX or PRODUCTION).

  • avalara_password (String)

    The password for the Avalara account.

  • avalara_username (String)

    The username for the Avalara account.

  • delivery_method_ids (Array<String>)

    The delivery method IDs of the billing provider configurations to update, can be

  • commit_transactions (Boolean)

    Commit transactions if you want Metronome tax calculations used for reporting an

  • request_options (MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



40
41
42
43
44
45
46
47
48
49
# File 'lib/metronome_sdk/resources/v1/settings.rb', line 40

def upsert_avalara_credentials(params)
  parsed, options = MetronomeSDK::V1::SettingUpsertAvalaraCredentialsParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/upsertAvalaraCredentials",
    body: parsed,
    model: MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsResponse,
    options: options
  )
end