# Tobacco, nicotine, and vape transaction details

Source: https://developer.avalara.com/products/excise/integration-guides/excise/wni2280148245494/

Guide: AvaTax Excise

# Tobacco, nicotine, and vape transaction details

Learn how to run a tobacco, nicotine, or vape transaction using Avalara's API endpoints.

You can run ATE transactions using the [CreateTransaction](https://developer.avalara.com/api-reference/excise/v1/methods/AvaTaxExciseController/AvaTaxExciseController_CreateTransaction/) endpoint or the [CreateOrAdjustTransaction](https://developer.avalara.com/api-reference/excise/v1/methods/AvaTaxExciseController/AvaTaxExciseController_CreateOrAdjustTransaction/) endpoint. For each request, the following are required in the header:

-   `Authorization` using basic HTTP authentication

-   `x-company-id` (provided during provisioning)

-   `Content-Type: application/json`

The following models are also required in each transaction. These are shown and described in the code example below.

-   [Transaction elements](https://developer.avalara.com/api-reference/excise/v1/models/Avalara.Excise.Determination.Engine.RestTransaction/)

-   [Transaction line elements](https://developer.avalara.com/api-reference/excise/v1/models/Avalara.Excise.Determination.Engine.RestTransactionLine/)

In addition to the required models listed above, you can also optionally specify models for [exchange rates](https://developer.avalara.com/api-reference/excise/v1/models/Avalara.Excise.Determination.Engine.RestTransactionExchangeRate/), [transaction line measures](https://developer.avalara.com/api-reference/excise/v1/models/Avalara.Excise.Determination.Engine.RestTransactionLineMeasure/), and [special jurisdictions](https://developer.avalara.com/api-reference/excise/v1/models/Avalara.Excise.Determination.Engine.RestTransactionLineJurisdiction/) for origin, destination, and sale locations.

The example below shows a simple vape adjustment transaction with transaction and transaction line elements.

```
{
  "AdjustmentReason": "Other", //--Required: Potential Values: NotAdjusted, SourcingIssue, ReconciledWithGeneralLedger, ExemptCertApplied, PriceAdjusted, ProductReturned, ProductExchanged, BadDebt, Other, Offline
  "AdjustmentDescription": "Price drop after shipping", //--Optional
  "newTransaction": {
    "TransactionLines": [
      {
        "InvoiceLine": 10, //--Important value indicating which invoice line corresponds to the tax line in the response//--Important value indicating which invoice line corresponds to the tax line in the response
        "ProductCode": "LIQUIDNIC", //--ProductCode that ATE recognizes, or any alternate mapped value. ATE recognizes, or any alternate mapped value.
        //"ProductCode" : "50529",
        "UnitPrice": 1, //--Sale Price Per Unit
        "AlternateUnitPrice": 1, //Required --Cost Per Unit. Used for calculation of taxes in sales from manufacturing. Used for calculation of taxes in sales from manufacturing
        "BilledUnits": 2, //--Required: Number of Units sold.  This is an API critical error if not passed or set to 0.  If a negative value is passed it will change the Tax Amount to negative.
        // passing BilledUnits will trigger ATE
        // for a return set this value to negative
        "NetUnits": 2, //--Required: the ability to pass multiple ways of counting of number of units.  Resides on the Materials Master for the SKUs.o pass multiple ways of counting of number of units.  Resides on the Materials Master for the SKUs.
        // passing NetUnits will set the Qty in AvaTax
        // for a return keep value positive
        "UnitOfMeasure": "PAK", //Required --NOTE: If unable to pass through API, attributes can be assigned directly to the ProductCode within ATE for lookup. Required for tax calculations.o pass through API, attributes can be assigned directly to the ProductCode within ATE for lookup. Required for tax calculations.
        "OriginCountryCode": "USA", //--Location Fields. SaleLocation can be hard coded within ATE if client has only one sales office. Otherwise multi-location sales office locations will need to be passed in the request.lds. SaleLocation can be hard coded within ATE if client has only one sales office. Otherwise multi-location sales office locations will need to be passed in the request.
        "OriginJurisdiction": "IL", //--Required for base minimum sales tax calculations.
        "OriginCounty": "Cook",
        "OriginCity": "Chicago",
        "OriginPostalCode": "60601", //--Required for base minimum sales tax calculations.r base minimum sales tax calculations.
        "OriginAddress1": "", //--Best Practice: if field can be sourced, pass this value.
        "DestinationCountryCode": "USA", //--Required for base minimum sales tax calculations. NOTE Avalara has Tobacco content for USA Only.  You will recieve a Scenario ERROR if you go outside the USA
        "DestinationJurisdiction": "IL", //--Required for base minimum sales tax calculations.
        "DestinationCounty": "Cook",
        "DestinationCity": "Chicago",
        "DestinationPostalCode": "60601", //--Required for base minimum sales tax calculations.ed for base minimum sales tax calculations.
        "DestinationAddress1": "", //--Best Practice: if field can be sourced, pass this value.
        "SaleCountryCode": "USA", //--Required for base minimum sales tax calculations.
        "SaleJurisdiction": "IL", //--Required for base minimum sales tax calculations.
        "SaleCounty": "Cook",
        "SaleCity": "Chicago",
        "SalePostalCode": "60601", //--Required for base minimum sales tax calculations.base minimum sales tax calculations.
        "SaleAddress1": "", //--Best Practice: if field can be sourced, pass this value.
        "UserData": "Test_Vapor", //--Optional Field.  Value will return in the UserReturnedValue field in the Response at the line level.  Value will return in the UserReturnedValue field in the Response at the line level.
        "Currency": "USD", //--Required, however ATE will default to USD if NULL. will default to USD if NULL.
        "CustomString1": "Flag1", //--Future customizability field. Pass in API even if not sourced.
        "CustomString2": "Flag2", //--Future customizability field. Pass in API even if not sourced.
        "CustomString3": "Flag3", //--Future customizability field. Pass in API even if not sourced.
        "CustomString4": "Flag4", //--Future customizability field. Pass in API even if not sourced.
        "CustomString5": "Flag5", //--Future customizability field. Pass in API even if not sourced.
        "CustomString6": "Flag6", //--Future customizability field. Pass in API even if not sourced.
        "CustomString7": "Flag7", //--Future customizability field. Pass in API even if not sourced.
        "CustomString8": "Flag8", //--Future customizability field. Pass in API even if not sourced.
        "CustomString9": "Flag9", //--Future customizability field. Pass in API even if not sourced.
        "CustomString10": "Flag10", //--Future customizability field. Pass in API even if not sourced.
        "CustomNumeric1": 1, //--Future customizability field. Pass in API even if not sourced.
        "CustomNumeric2": 2, //--Future customizability field. Pass in API even if not sourced.
        "CustomNumeric3": 3, //--Future customizability field. Pass in API even if not sourced.
        "CustomNumeric4": 4, //--Future customizability field. Pass in API even if not sourced.
        "CustomNumeric5": 5, //--Future customizability field. Pass in API even if not sourced.
        "CustomNumeric6": 6, //--Future customizability field. Pass in API even if not sourced.
        "CustomNumeric7": 7, //--Future customizability field. Pass in API even if not sourced.
        "CustomNumeric8": 8, //--Future customizability field. Pass in API even if not sourced.
        "CustomNumeric9": 9, //--Future customizability field. Pass in API even if not sourced.
        "CustomNumeric10": 10, //--Future customizability field. Pass in API even if not sourced.
        "EntityUseCode": "" //--Optional for full ATE/Avatax Integrations: EntityUseCode value to be passed to Avatax at the line level to key Sales/Use Tax Exemptions:
        //----Valid values: A-Federal Government, B-State Government, C-Tribal Government, D-Foreign Diplomat, E-Charitable/Exempt, F-Religious Organization
        //----(cont) G: Resale, H-Agriculture, I-Industrial Prod/Manufacturers, J-Direct Pay, K-Direct Mail, M-Educational Org, N-Local Government, P-Commerical Aquaculture
        //----(cont) Q-Commerical Fishery, R-Non-Resident (Custom EntityUseCode can also be leveraged)
      }
    ],
    "EffectiveDate" : "08-23-24",
    "InvoiceDate": "08-23-24", //--Required. Needed for transaction tracing
    "InvoiceNumber": "Test", //--Required. Needed for transaction tracing.  Also this value is mapped to purchaseOrderNo in AvaTax and can be used to trigger a Single Use Exemption Scenario in AvaTax with ECM.
    "TitleTransferCode": "DEST", //--Required. DEFAULT AS 'DEST'. All will call sales would need the office location as Destination.
    "TransactionType": "DIRECT", //--Required. WHOLESALE or RETAIL (DIRECT Direct to Consumer TransactionType released 7/1/2021). Build to all 3: WHOLESALE is B2B, RETAIL is POS Store Front, DIRECT is Online Sales.
    "Seller": "RESELLER", //--Required. Matches the CustomId of the Seller in the business_entities table.  The matching Business Entity must be in ATE for the value to be passed to AvaTax
    "Buyer" :"CUSTOMER", //--Required. Matches the CustomId of the Seller in the business_entities table.
    "UserData": "TEST_LIQUID_NIC", //--Optional Field.  Value will return in the UserReturnedValue field in the Response at the eader level.
    "UserTranId": "GUID_TEST_LIQUID_NIC", //--Required.  Pass unique GUID here to correspond to the "doc_code" within Avatax for Committing.
    "SourceSystem": "Your Applicatoin name and version, SF Version UID", //--Required.
    "CustomString1": "Flag1", //--Future customizability field. Pass in API even if not sourced.
    "CustomString2": "Flag2", //--Future customizability field. Pass in API even if not sourced.
    "CustomString3": "Flag3", //--Future customizability field. Pass in API even if not sourced.
    "CustomString4": "Flag4", //--Future customizability field. Pass in API even if not sourced.
    "CustomString5": "Flag5", //--Future customizability field. Pass in API even if not sourced.
    "CustomString6": "Flag6", //--Future customizability field. Pass in API even if not sourced.
    "CustomString7": "Flag7", //--Future customizability field. Pass in API even if not sourced.
    "CustomString8": "Flag8", //--Future customizability field. Pass in API even if not sourced.
    "CustomString9": "Flag9", //--Future customizability field. Pass in API even if not sourced.
    "CustomString10": "Flag10", //--Future customizability field. Pass in API even if not sourced.
    "CustomNumeric1": 1, //--Future customizability field. Pass in API even if not sourced.
    "CustomNumeric2": 2, //--Future customizability field. Pass in API even if not sourced.
    "CustomNumeric3": 3, //--Future customizability field. Pass in API even if not sourced.
    "CustomNumeric4": 4, //--Future customizability field. Pass in API even if not sourced.
    "CustomNumeric5": 5, //--Future customizability field. Pass in API even if not sourced.
    "CustomNumeric6": 6, //--Future customizability field. Pass in API even if not sourced.
    "CustomNumeric7": 7, //--Future customizability field. Pass in API even if not sourced.
    "CustomNumeric8": 8, //--Future customizability field. Pass in API even if not sourced.
    "CustomNumeric9": 9, //--Future customizability field. Pass in API even if not sourced.
    "CustomNumeric10": 10, //--Future customizability field. Pass in API even if not sourced.
    "AvataxTransactionType": "SalesInvoice", //--Specifies which type of transaction it is: AP/AR/Quote/Inventory Movement. Valid values: SalesOrder, SalesInvoice (Default if not populated), PurchaseOrder, PurchaseInvoice, ReturnOrder, ReturnInvoice, InventoryTransferOrder, InventoryTransferInvoice.
    "EntityUseCode": "" //--Required for full ATE/Avatax Integrations: EntityUseCode value to be passed to Avatax at the line level to key Sales/Use Tax Exemptions:
    //----Valid values: A-Federal Government, B-State Government, C-Tribal Government, D-Foreign Diplomat, E-Charitable/Exempt, F-Religious Organization
    //----(cont) G: Resale, H-Agriculture, I-Industrial Prod/Manufacturers, J-Direct Pay, K-Direct Mail, M-Educational Org, N-Local Government, P-Commerical Aquaculture
    //----(cont) Q-Commerical Fishery, R-Non-Resident (Custom EntityUseCode can also be leveraged)
  }
}
```