This example show a beverage alcohol sales invoice transaction to an address in Canada. In this example:
shipTo
address is in Canada.taxCode
is a valid code for compliance verification:PA2020300
.routeType
is a valid type for compliance verification:DTC
.The following transaction shows a request for purchasing packaged alcohol wine and shipping to Canada.
curl
-X POST
-H 'Accept: application/json'
-H 'Authorization: Basic aHR0cHdhdQNoOmY='
-H 'Content-Type: application/json'
--data '{
"type":"SalesInvoice",
"code": "123434390852",
"companyCode":"DEFAULT",
"customerCode":"13434",
"date":"2021-03-10",
"commit":true,
"lines": [
{
"number":"1",
"quantity":10,
"amount":100,
"taxCode":"PA2020300",
"itemCode":"12345",
"description":"Packaged alcohol wine",
"parameters":[
{
"name":"AlcoholRouteType",
"value":"DTC"
},
{
"name":"RecipientName",
"value":"John Smith"
},
{
"name":"PurchaserDOB",
"value":"1995-03-29"
},
{
"name":"RecipientDOB",
"value":"2000-01-02"
},
{
"name":"ContainerSize",
"value":"0.75",
"unit":"Litre"
},
{
"name":"AlcoholContent",
"value":"12.5",
"unit":"Percentage"
},
{
"name":"PackSize",
"value":"12",
"unit":"Count"
},
{
"name":"NetVolume",
"value":"750",
"unit":"Millilitre"
}
]
}
],
"addresses": {
"shipFrom":{
"line1":"255 S King St",
"line2":"Suite 1200",
"city":"Seattle",
"region":"WA",
"country":"US",
"postalCode":"98104"
},
"shipTo":{
"line1":"2220 Wyandotte St E",
"city":"Windsor",
"region":"ON",
"country":"CA",
"postalCode":"N8Y1E7"
}
}
}'
'https://sandbox-rest.avatax.com/api/v2/transactions/create'
In the verification request, be sure to include yourcompanyCode
and the transactioncode
. In the transaction above, thecompanyCode
isDEFAULT
, and the transactioncode
is123434390852
.
curl
-X GET
-H 'Accept: application/json'
-H 'Authorization: Basic aHR0cHdhdQNoOmY='
-H 'Content-Type: application/json'
'https://sandbox-rest.avatax.com/api/v2/companies/DEFAULT/transactions/123434390852/shipment/verify'
The response returns"compliant": true
even though the address is unsupported. Just as with unsupported tax codes, AvaTax treats addresses that are unsupported as compliant.
{
"compliant": true,
"warningCodes": [
"UnsupportedAddress"
],
"message": "Transaction is compliant",
"successMessages": "",
"failureMessages": "",
"failureCodes": [],
"lines": [
{
"resultCode": "UnsupportedAddress",
"lineNumber": "1",
"message": "Line refers to an unsupported address",
"successMessages": "",
"failureMessages": "",
"failureCodes": []
}
]
}