I suggest not modifying the plugin code unless necessary.
Type
"SalesOrder" is used to pre-calculate taxes in the cart and during the checkout process, and such a request isn't saved in the transaction history. Type
"SalesInvoice" is used for the final tax calculation when placing an order and is saved in the transaction history, you can see it in your AvaTax account.
I completed the request by our test account using your data from previous posts. Here is the result.
request:
{
"lines": [
{
"quantity": 2.0,
"amount": 118.1400,
"itemCode": "11521",
"exemptionCode": "",
"discounted": false,
"description": "Test T-Shirt"
}
],
"type": "SalesOrder",
"companyCode": "APITrialCompany",
"date": "2023-09-19T11:19:41.523822Z",
"customerCode": "35700",
"discount": 0.0,
"exemptionNo": "Exempt-customer-#35700",
"addresses": {
"shipFrom": {
"line1": "PO Box 123",
"city": "Mequon",
"region": "WI",
"country": "US",
"postalCode": "53097"
},
"shipTo": {
"line1": "123 Main St",
"city": "BUFFALO",
"region": "WY",
"country": "US",
"postalCode": "82831-1234"
}
},
"email": "<REDACTED>"
}
response:
{
"id": 0,
"code": "d3b3224a-c186-4b75-abb7-eb7b1b06995a",
"companyId": "<REDACTED>",
"date": "2023-09-19",
"paymentDate": "2023-09-19",
"status": "Temporary",
"type": "SalesOrder",
"batchCode": "",
"currencyCode": "USD",
"exchangeRateCurrencyCode": "USD",
"customerUsageType": "",
"entityUseCode": "",
"customerVendorCode": "35700",
"customerCode": "35700",
"exemptNo": "Exempt-customer-#35700",
"reconciled": false,
"locationCode": "",
"reportingLocationCode": "",
"purchaseOrderNo": "",
"referenceCode": "",
"salespersonCode": "",
"totalAmount": 118.14,
"totalExempt": 118.14,
"totalDiscount": 0.0,
"totalTax": 0.0,
"totalTaxable": 0.0,
"totalTaxCalculated": 0.0,
"adjustmentReason": "NotAdjusted",
"locked": false,
"version": 1,
"exchangeRateEffectiveDate": "2023-09-19",
"exchangeRate": 1.0,
"email": "<REDACTED>",
"modifiedDate": "2023-09-19T11:20:16.7601038Z",
"modifiedUserId": 212348,
"taxDate": "2023-09-19",
"lines": [
{
"id": 0,
"transactionId": 0,
"lineNumber": "1",
"customerUsageType": "",
"entityUseCode": "",
"description": "Test T-Shirt",
"discountAmount": 0.0,
"exemptAmount": 118.14,
"exemptCertId": 0,
"exemptNo": "",
"isItemTaxable": false,
"itemCode": "11521",
"lineAmount": 118.14,
"quantity": 2.0,
"ref1": "",
"ref2": "",
"reportingDate": "2023-09-19",
"tax": 0.0,
"taxableAmount": 0.0,
"taxCalculated": 0.0,
"taxCode": "P0000000",
"taxCodeId": 8087,
"taxDate": "2023-09-19",
"taxIncluded": false,
"details": [
{
"id": 0,
"transactionLineId": 0,
"transactionId": 0,
"country": "US",
"region": "WY",
"exemptAmount": 118.14,
"jurisCode": "56",
"jurisName": "WYOMING",
"stateAssignedNo": "",
"jurisType": "STA",
"jurisdictionType": "State",
"nonTaxableAmount": 0.0,
"rate": 0.040000,
"tax": 0.0,
"taxableAmount": 0.0,
"taxType": "Sales",
"taxSubTypeId": "S",
"taxName": "WY STATE TAX",
"taxAuthorityTypeId": 45,
"taxCalculated": 0.0,
"rateType": "General",
"rateTypeCode": "G",
"unitOfBasis": "PerCurrencyUnit",
"isNonPassThru": false,
"isFee": false,
"reportingTaxableUnits": 0.0,
"reportingNonTaxableUnits": 0.0,
"reportingExemptUnits": 118.14,
"reportingTax": 0.0,
"reportingTaxCalculated": 0.0,
"liabilityType": "Seller",
"chargedTo": "Buyer"
},
{
"id": 0,
"transactionLineId": 0,
"transactionId": 0,
"country": "US",
"region": "WY",
"exemptAmount": 118.14,
"jurisCode": "019",
"jurisName": "JOHNSON",
"stateAssignedNo": "16",
"jurisType": "CTY",
"jurisdictionType": "County",
"nonTaxableAmount": 0.0,
"rate": 0.010000,
"tax": 0.0,
"taxableAmount": 0.0,
"taxType": "Sales",
"taxSubTypeId": "S",
"taxName": "WY COUNTY TAX",
"taxAuthorityTypeId": 45,
"taxCalculated": 0.0,
"rateType": "General",
"rateTypeCode": "G",
"unitOfBasis": "PerCurrencyUnit",
"isNonPassThru": false,
"isFee": false,
"reportingTaxableUnits": 0.0,
"reportingNonTaxableUnits": 0.0,
"reportingExemptUnits": 118.14,
"reportingTax": 0.0,
"reportingTaxCalculated": 0.0,
"liabilityType": "Seller",
"chargedTo": "Buyer"
}
],
"nonPassthroughDetails": [],
"hsCode": "",
"costInsuranceFreight": 0.0,
"vatCode": "",
"vatNumberTypeId": 0
}
],
"addresses": [
{
"id": 0,
"transactionId": 0,
"boundaryLevel": "Address",
"line1": "123 Main St",
"line2": "",
"line3": "",
"city": "BUFFALO",
"region": "WY",
"postalCode": "82831-1234",
"country": "US",
"taxRegionId": 4005530,
"latitude": "44.345528",
"longitude": "-106.698155"
},
{
"id": 0,
"transactionId": 0,
"boundaryLevel": "Zip5",
"line1": "PO Box 123",
"line2": "",
"line3": "",
"city": "Mequon",
"region": "WI",
"postalCode": "53097",
"country": "US",
"taxRegionId": 4006722,
"latitude": "43.221791",
"longitude": "-87.951726"
}
],
"summary": [
{
"country": "US",
"region": "WY",
"jurisType": "State",
"jurisCode": "56",
"jurisName": "WYOMING",
"taxAuthorityType": 45,
"stateAssignedNo": "",
"taxType": "Sales",
"taxSubType": "S",
"taxName": "WY STATE TAX",
"rateType": "General",
"taxable": 0.0,
"rate": 0.040000,
"tax": 0.0,
"taxCalculated": 0.0,
"nonTaxable": 0.0,
"exemption": 118.14
},
{
"country": "US",
"region": "WY",
"jurisType": "County",
"jurisCode": "019",
"jurisName": "JOHNSON",
"taxAuthorityType": 45,
"stateAssignedNo": "16",
"taxType": "Sales",
"taxSubType": "S",
"taxName": "WY COUNTY TAX",
"rateType": "General",
"taxable": 0.0,
"rate": 0.010000,
"tax": 0.0,
"taxCalculated": 0.0,
"nonTaxable": 0.0,
"exemption": 118.14
}
]
}
The text of the requests is almost the same, but as you can see the difference in the response is in the field
"isItemTaxable", in my case it's
"false", which leads to the correct calculation of taxes.
So the plugin works correctly. I recommend you place a test order (type
"SalesInvoice", so that the transaction is saved in account history) and contact Avalara support with a reference to this transaction, perhaps a problem in your AvaTax account settings.