Module: AvaTax::Client::GLAccount

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

Instance Method Summary collapse

Instance Method Details

#bulk_upload_g_l_accounts(companyid, model) ⇒ Object

Bulk upload GL accounts

Allows a bulk upload of GL accounts for the specified company. Use the companyid path parameter to identify the company for which the GL accounts should be uploaded. Swagger Name: AvaTaxClient

Parameters:

  • companyid (Integer)

    The ID of the company that owns this GL account object

  • model (Object)

    The GL account bulk upload model.

Returns:

  • (Object)


13
14
# File 'lib/avatax/client/glaccount.rb', line 13

def bulk_upload_g_l_accounts(companyid, model)        path = "/api/v2/companies/#{companyid}/glaccounts/$upload"
post(path, model, {}, AvaTax::VERSION)      end

#create_g_l_account(companyid, model) ⇒ Object

Create a new GL account

Creates one or more new GL account objects attached to this company.

A GL account is a general ledger account that can be passed to transactions at the line level to apply the multiple rules of the transactions, including exemptions, allocations, etc. to a specific general ledger. Swagger Name: AvaTaxClient

Parameters:

  • companyid (Integer)

    The ID of the company that owns this GL Account object

  • model (Object)

    The GL Account you want to create

Returns:

  • (Object)


25
26
# File 'lib/avatax/client/glaccount.rb', line 25

def (companyid, model)        path = "/api/v2/companies/#{companyid}/glaccounts"
post(path, model, {}, AvaTax::VERSION)      end

#delete_g_l_account(companyid, glaccountid) ⇒ Object

Delete the GL account associated with the given company ID and GL account ID

Deletes the GL account associated with the specified glaccountid and companyid Swagger Name: AvaTaxClient

Parameters:

  • companyid (Integer)

    The ID of the company that owns this GL account object

  • glaccountid (Integer)

    The primary key of this GL account

Returns:

  • (Object)


35
36
# File 'lib/avatax/client/glaccount.rb', line 35

def (companyid, glaccountid)        path = "/api/v2/companies/#{companyid}/glaccounts/#{glaccountid}"
delete(path, {}, AvaTax::VERSION)      end

#get_g_l_account_by_id(companyid, glaccountid) ⇒ Object

Retrieve a single GL account

Retrieve details of a single GL account identified by its glaccountid and companyid Swagger Name: AvaTaxClient

Parameters:

  • companyid (Integer)

    The ID of the company that owns this GL account object

  • glaccountid (Integer)

    The primary key of this GL account

Returns:

  • (Object)


45
46
# File 'lib/avatax/client/glaccount.rb', line 45

def (companyid, glaccountid)        path = "/api/v2/companies/#{companyid}/glaccounts/#{glaccountid}"
get(path, {}, AvaTax::VERSION)      end

#list_g_l_accounts_by_company(companyid, options = {}) ⇒ FetchResult

Retrieve GL accounts for this company

Retrieves a list of GL accounts attached to this company. You can apply filters to retrieve specific records. Swagger Name: AvaTaxClient

Parameters:

  • companyid (Integer)

    The ID of the company that owns these GL accounts

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: companyId, meta, defaultItem

  • include (String)

    A comma separated list of objects to fetch underneath this company. Any object with a URL path underneath this company can be fetched by specifying its name.

  • 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)


59
60
# File 'lib/avatax/client/glaccount.rb', line 59

def list_g_l_accounts_by_company(companyid, options={})        path = "/api/v2/companies/#{companyid}/glaccounts"
get(path, options, AvaTax::VERSION)      end

#update_g_l_account(companyid, glaccountid, model) ⇒ Object

Update a single GL account

Updates a single GL account owned by the company. Use the glaccountid path parameter to identify the GL account to update. Swagger Name: AvaTaxClient

Parameters:

  • companyid (Integer)

    The ID of the company that owns this GL Account object

  • glaccountid (Integer)

    The primary key of this GL Account

  • model (Object)

    The GL account object you want to update

Returns:

  • (Object)


70
71
# File 'lib/avatax/client/glaccount.rb', line 70

def (companyid, glaccountid, model)        path = "/api/v2/companies/#{companyid}/glaccounts/#{glaccountid}"
put(path, model, {}, AvaTax::VERSION)      end