Method: AvaTax::Client::Transactions#commit_transaction

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

#commit_transaction(companyCode, transactionCode, model, options = {}) ⇒ Object

Commit a transaction for reporting

Marks a transaction by changing its status to Committed.

Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns.

A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like sales, purchases, inventory transfer, and returns (also called refunds).

If you have more than one document with the same code, specify the documentType parameter to choose between them.

Any changes made to a committed transaction will generate a transaction history.

You may specify one or more of the following values in the $include parameter to fetch additional nested data, using commas to separate multiple values:

  • Lines
  • Details (implies lines)
  • AccountPayableSalesTaxDetails (implies lines - only for Account Payable transaction)
  • Summary (implies details)
  • Addresses
  • SummaryOnly (omit lines and details - reduces API response size)
  • LinesOnly (omit details - reduces API response size)
  • TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.

NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:

  • Replace '/' with '_-ava2f-_' For example: document/Code becomes document_-ava2f-_Code
  • Replace '+' with '_-ava2b-_' For example: document+Code becomes document_-ava2b-_Code
  • Replace '?' with '_-ava3f-_' For example: document?Code becomes document_-ava3f-_Code
  • Replace '%' with '_-ava25-_' For example: document%Code becomes document_-ava25-_Code
  • Replace '#' with '_-ava23-_' For example: document#Code becomes document_-ava23-_Code
  • Replace ' ' with '%20' For example: document Code becomes document%20Code

Security Policies

  • This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient

Parameters:

  • companyCode (String)

    The company code of the company that recorded this transaction

  • transactionCode (String)

    The transaction code to commit

  • documentType (String)

    (Optional): The document type of the transaction to commit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)

  • include (String)

    Specifies objects to include in this fetch call

  • model (Object)

    The commit request you wish to execute

Returns:

  • (Object)


272
273
# File 'lib/avatax/client/transactions.rb', line 272

def commit_transaction(companyCode, transactionCode, model, options={})        path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/commit"
post(path, model, options, AvaTax::VERSION)      end