class Avatax::Api::Accounts
Accounts
Client
@see developer.avalara.com/avatax/api-reference/tax/v2/Accounts/
Public Instance Methods
Activate an account @see developer.avalara.com/avatax/api-reference/tax/v2/Accounts/#ActivateAccount
@param account_id [String, Integer] The ID of the account to activate. @param args [Hash] The arguments for avatax. @return [Avatax::Response]
# File lib/avatax/api/accounts.rb, line 16 def activate(account_id, args = {}) post_for(:activate, account_id, args) end
Get configuration for an account @see developer.avalara.com/avatax/api-reference/tax/v2/Accounts/#GetAccountConfiguration
@param account_id [String, Integer] The ID of the account to activate. @param args [Hash] The arguments for avatax. @return [Avatax::Response]
# File lib/avatax/api/accounts.rb, line 28 def configuration(account_id, args = {}) get_for(:configuration, account_id, args) end
Get an account. @see developer.avalara.com/avatax/api-reference/tax/v2/Accounts/#GetAccount
@param account_id [String, Integer] The ID of the account to activate. @param args [Hash] The arguments for avatax. @return [Avatax::Response]
# File lib/avatax/api/accounts.rb, line 64 def get(account_id, args = {}) get_for(nil, account_id, args) end
Reset the license key for an account. @see developer.avalara.com/avatax/api-reference/tax/v2/Accounts/#AccountResetLicenseKey
@param account_id [String, Integer] The ID of the account to activate. @param args [Hash] The arguments for avatax. @return [Avatax::Response]
# File lib/avatax/api/accounts.rb, line 52 def reset_license_key(account_id, args = {}) post_for(:resetlicensekey, account_id, args) end
Update configuration for an account @see developer.avalara.com/avatax/api-reference/tax/v2/Accounts/#SetAccountConfiguration
@param account_id [String, Integer] The ID of the account to activate. @param args [Hash] The arguments for avatax. @return [Avatax::Response]
# File lib/avatax/api/accounts.rb, line 40 def update_configuration(account_id, args = {}) post_for(:configuration, account_id, args) end
Private Instance Methods
# File lib/avatax/api/accounts.rb, line 70 def get_for(endpoint, account_id, args) request_for(:get, endpoint, account_id, args) end
# File lib/avatax/api/accounts.rb, line 74 def post_for(endpoint, account_id, args) request_for(:post, endpoint, account_id, args) end
# File lib/avatax/api/accounts.rb, line 78 def request_for(method, endpoint, account_id, args) raise ArgumentError, 'account_id is required' if account_id.blank? resp = connection.send method, "/api/v2/accounts/#{account_id}/#{endpoint}", args handle_response(resp) end