Transactions table for AvalaraAvatax data provider.
The adapter will use the Avalara API to process WHERE clause conditions built with the following columns and operators. Most of the columns support server side filtering with the following operators: =,>,<,<=,>=,IN,NOT,IN,AND,OR,LIKE. The rest of the filter is executed client side within the adapter. By default the Adjusted transactions will not be listed. If you want to include them, you need to set IncludeAdjustedTransactions to true.
For example, the following query is processed server side:
SELECT * FROM Transactions WHERE AdjustmentReason = 'PriceAdjusted' SELECT * FROM Items WHERE Status = 'Cancelled'
To add a new Transaction item, the following columns need to be specified: CustomerCode, Date, Type, LinkedLines, Code, LinkedAddresses. If you want to commit the transaction, set the Commit flag in the request to true. The linked columns can be inserted using a #Temp table or by passing the aggregate value.
The LinkedAddresses aggregate must include information about the origin and destination address. If this transaction occurred at a retail point-of-sale location, provide that single address here and leave all other address types null. If origin differs from destination, insert both ShipFrom and ShipTo address types. If you wish to use the address of an existing location for the actual company, specify the address in the addressType_locationCode field.
The examples below illustrate the aforementioned scenarios.
Inserting LinkedAddresses aggregate through #Temp table with SingleLocation:
INSERT INTO Addresses#Temp (SingleLocation_line1, SingleLocation_City, SingleLocation_County, SingleLocation_PostalCode) VALUES ('2000 Main Street', 'Irvine', 'US', 92614)") INSERT INTO Addresses#Temp (SingleLocation_locationCode) VALUES ('LC001')")
Inserting LinkedAddresses aggregate through #Temp table with ShipFrom and ShipTo locations:
INSERT INTO Addresses#Temp (shipTo_line1, shipTo_City, shipTo_County, shipTo_PostalCode, shipFrom_line1, shipFrom_City, shipFrom_Country, shipFrom_PostalCode) VALUES ('2000 Main Street', 'Irvine', 'US', 92614, '', '', 'US', '')") INSERT INTO Addresses#Temp (shipTo_locationCode, shipFrom_locationCode) VALUES ('LC001','LC002')")
Insert line items aggregate using #Temp table. For a list of the columns you can insert into the temporary table, refer to TransactionLines table.
INSERT INTO TransactionLines#Temp (ItemCode, Quantity, LineAmount) VALUES ('IC005', 3, 300)")
Insert into the main Transactions table :
INSERT INTO Transactions (LinkedLines,LinkedAddresses, Code, CompanyId, CustomerCode, Date, Type, Commit, TotalTax) VALUES (TransactionLines#Temp, Addresses#Temp, DC008, 247015, 'CC002', '09/30/2019', 'SalesInvoice', true, 12.0)")
Avalara allows updates on Transactions. To update a transaction, AdjustmentReason and Adjustment description are required fields. Additionally, you need to specify the Code of the transaction you are updating in the WHERE clause.
Similarly, to Insert, you can update line items using temporary tables. To update an existing line, include the LineNumber of the line you wish to update. To insert a new line in the transaction, set the LineNumber to a new, non-existing value.
When a transaction is updated, the actual transaction's status changes to Adjusted and a new transaction with the updated information is created. The new transaction will have the same document code, but a different id and status: Saved or Commited. If you wish to commit the new updated transaction, set the Commit flag in the request to true.
INSERT INTO TransactionLines#Temp (ItemCode, Quantity, LineAmount, LineNumber) VALUES (IC007, 3, 300, 3) UPDATE Transactions SET LinkedLines = 'TransactionLines#Temp', AdjustmentDescription = 'MyDescription', AdjustmentReason = 'PriceAdjusted' WHERE Code = '051349'
The unique ID number of this transaction.
A unique customer-provided code identifying this transaction.
The unique ID number of the company that recorded this transaction.
If this transaction included foreign currency exchange, this is the date as of which the exchange rate was calculated.
The salesperson who provided this transaction. Not required.
If this transaction was adjusted, indicates a description of the reason why the transaction was adjusted.
The unique ID number of the destination address for this transaction.
A list of location types in this transaction.
By default, the value is null, when the value is null, the value can be set at nexus level and used. If the value is not null, it will override the value at nexus level. If true, this seller was considered the importer of record of a product shipped internationally.
If this transaction was created as part of a batch, this code indicates which batch.
Contains the tax details per tax type
Tax date for this transaction
The entity use code for this transaction. Entity use codes often affect exemption or taxability rules.
Invoice messages associated with this transaction. Currently, this stores legally-required VAT messages.
Description of this transaction. Field permits unicode values.
A list of addreses used in this transaction.
The total tax for all lines in this transaction.
List of informational and warning messages regarding this API call. These messages are only relevant to the current API call.
The customer Tax Id Number (taxMyUserumber) associated with a certificate.
The portion of the total amount of this transaction that was taxable.
The date/time when this record was last modified.
Email address associated with this transaction.
If a tax override was applied to this transaction, indicates what type of tax override was applied.
VAT business identification number used for this transaction.
For customers who use location-based tax reporting, this field controls how this transaction will be filed for multi-location tax filings.
The amount of tax that AvaTax calculated for the transaction.
If this transaction included foreign currency exchange, this is the exchange rate that was used.
Unique code identifying the customer that requested this transaction.
If this transaction has been reported to a tax authority, this transaction is considered locked and may not be adjusted after reporting.
The status of the transaction.
The total amount of this transaction.
A list of line items in this transaction.
The total amount of discounts applied to all lines within this transaction.
If this transaction was adjusted, indicates the unique ID number of the reason why the transaction was adjusted.
If a tax override was applied to this transaction, indicates the amount of tax that was requested by the customer.
The software version used to calculate this transaction.
The two-character ISO 3166 code of the country for this transaction.
The three-character ISO 4217 currency code that was used for payment for this transaction.
The unique ID number of the origin address for this transaction.
The amount of this transaction that was exempt.
The customer-supplied purchase order number of this transaction.
If a tax override was applied to this transaction, indicates the reason for the tax override.
The override tax date to use
Contains a list of extra parameters that were set when the transaction was created.
Contains a summary of tax on this transaction.
If this transaction was adjusted, this indicates the version number of this transaction. Incremented each time the transaction is adjusted.
The date on which this transaction occurred.
The user ID of the user who last modified this record.
The two-or-three character ISO region code of the region for this transaction.
A user-defined reference code for this transaction.
If this transaction has been reconciled against the company's ledger, this value is set to true.
The type of the transaction.
Wether to commit a transaction on creation. Used only on inserts