Module: AvaTax::Client::CurrencyRoundingRules

Defined in:
lib/avatax/client/currencyroundingrules.rb

Instance Method Summary collapse

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

Parameters:

  • accountId (Integer)

    The unique ID number of the account that owns these currency rounding rules.

  • model (AccountCurrencyRoundingRuleModel[])

    The currency rounding rule object or objects you wish to create.

Returns:

  • (AccountCurrencyRoundingRuleModel[])


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

Parameters:

  • accountId (Integer)

    The unique ID number of the account that owns this currency rounding rule.

  • id (Integer)

    The unique ID number of the currency rounding rule to delete.

Returns:

  • (ErrorDetail[])


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

Parameters:

  • accountId (Integer)

    The ID of the account that owns this currency rounding rule.

  • id (Integer)

    The unique ID number of the currency rounding rule to retrieve.

Returns:

  • (Object)


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

Parameters:

  • accountId (Integer)

    The ID of the account whose currency rounding rules you wish to list.

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: createdDate, createdUserId, modifiedUserId

  • include (String)

    A comma separated list of additional data to retrieve.

  • top (Integer)

    If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.

  • skip (Integer)

    If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.

  • orderBy (String)

    A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC.

Returns:

  • (FetchResult)


82
83
# File 'lib/avatax/client/currencyroundingrules.rb', line 82

def list_currency_rounding_rules(accountId, options={})        path = "/api/v2/accounts/#{accountId}/currencyroundingrules"
get(path, options, 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

Parameters:

  • accountId (Integer)

    The unique ID number of the account that owns this currency rounding rule.

  • id (Integer)

    The unique ID number of the currency rounding rule to replace.

  • model (Object)

    The new currency rounding rule object to store.

Returns:

  • (Object)


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