Module: AvaTax::Client::CurrencyRoundingRules
- Defined in:
- lib/avatax/client/currencyroundingrules.rb
Instance Method Summary collapse
-
#create_currency_rounding_rules(accountId, model) ⇒ AccountCurrencyRoundingRuleModel[]
Create one or more currency rounding rules.
-
#delete_currency_rounding_rule(accountId, id) ⇒ ErrorDetail[]
Delete a single currency rounding rule.
-
#get_currency_rounding_rule(accountId, id) ⇒ Object
Retrieve a single currency rounding rule.
-
#list_currency_rounding_rules(accountId, options = {}) ⇒ FetchResult
Retrieve all currency rounding rules for this account.
-
#update_currency_rounding_rule(accountId, id, model) ⇒ Object
Update a currency rounding rule.
Instance Method Details
#create_currency_rounding_rules(accountId, model) ⇒ AccountCurrencyRoundingRuleModel[]
Create one or more currency rounding rules
Create one or more currency rounding rules for this account. Each rule sets the rounding precision for a currency over an effective-date window.
Windows for the same currency may overlap - for a given tax date the rule with the latest
effDate whose window contains that date applies. Two rules that share a currencyCode
and effDate are ambiguous and are rejected, whether the duplicate is against an existing
rule or against another rule in the same request.
A rule can only be created for a currency that already has an Avalara system default (see
GET api/v2/definitions/currencyroundingrules).
Security Policies
- This API requires one of the following user roles: AccountAdmin, AvaTaxOnlyAccountAdmin, BatchServiceAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient
26 27 |
# File 'lib/avatax/client/currencyroundingrules.rb', line 26 def create_currency_rounding_rules(accountId, model) path = "/api/v2/accounts/#{accountId}/currencyroundingrules" post(path, model, {}, AvaTax::VERSION) end |
#delete_currency_rounding_rule(accountId, id) ⇒ ErrorDetail[]
Delete a single currency rounding rule
Deletes the currency rounding rule identified by this URL. After deletion, calculation for that currency falls back to the Avalara default rule (or standard decimal precision if none).
Security Policies
- This API requires one of the following user roles: AccountAdmin, AvaTaxOnlyAccountAdmin, BatchServiceAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient
41 42 |
# File 'lib/avatax/client/currencyroundingrules.rb', line 41 def delete_currency_rounding_rule(accountId, id) path = "/api/v2/accounts/#{accountId}/currencyroundingrules/#{id}" delete(path, {}, AvaTax::VERSION) end |
#get_currency_rounding_rule(accountId, id) ⇒ Object
Retrieve a single currency rounding rule
Retrieves a single currency rounding rule identified by this URL.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient
55 56 |
# File 'lib/avatax/client/currencyroundingrules.rb', line 55 def get_currency_rounding_rule(accountId, id) path = "/api/v2/accounts/#{accountId}/currencyroundingrules/#{id}" get(path, {}, AvaTax::VERSION) end |
#list_currency_rounding_rules(accountId, options = {}) ⇒ FetchResult
Retrieve all currency rounding rules for this account.
Lists all account-specific currency rounding rules for this account.
Only rules created for this account are returned. When no rule exists for a currency on a transaction's tax date, the tax engine automatically applies the Avalara system default for that currency; if no system default exists, standard decimal precision is used (no rounding).
Each rule's precision is 0 (whole currency unit) or 2 (standard decimal cents).
Search for specific objects using the criteria in the $filter parameter; full documentation is available on Filtering in REST .
Paginate your results using the $top, $skip, and $orderBy parameters.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient
82 83 |
# File 'lib/avatax/client/currencyroundingrules.rb', line 82 def list_currency_rounding_rules(accountId, ={}) path = "/api/v2/accounts/#{accountId}/currencyroundingrules" get(path, , AvaTax::VERSION) end |
#update_currency_rounding_rule(accountId, id, model) ⇒ Object
Update a currency rounding rule
Replace the existing currency rounding rule at this URL with an updated object.
All data from the existing object will be replaced with data in the object you PUT.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AvaTaxOnlyAccountAdmin, BatchServiceAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient
99 100 |
# File 'lib/avatax/client/currencyroundingrules.rb', line 99 def update_currency_rounding_rule(accountId, id, model) path = "/api/v2/accounts/#{accountId}/currencyroundingrules/#{id}" put(path, model, {}, AvaTax::VERSION) end |