API access requires a bearer token, which can be obtained using your Avatax account ID and license key.
To acquire a bearer token:
hs-code-classificationcurl -X POST https://identity.avalara.com/connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=<avatax_account_id>&client_secret=<license key>&scope=hs-code-classification"Sample response:
{
"access_token": "<jwt_access_token>",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "hs-code-classification"
}avatax_apicurl -X POST https://identity.avalara.com/connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=<avatax_account_id>&client_secret=<license key>&scope=avatax_api"Sample response:
{
"access_token": "<jwt_access_token>",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "avatax_api"
}access_token can be used to interact with the API.access_token is valid for 1 hour, after which you will need to request a fresh token.API access requires a bearer token, which can be obtained using your Avatax account ID and license key.
To acquire a bearer token:
hs-code-classificationcurl -X POST https://ai-sbx.avlr.sh/connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=<avatax_account_id>&client_secret=<license key>&scope=hs-code-classification"Sample response:
{
"access_token": "<jwt_access_token>",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "hs-code-classification"
}avatax_apicurl -X POST https://ai-sbx.avlr.sh/connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=<avatax_account_id>&client_secret=<license key>&scope=avatax_api"Sample response:
{
"access_token": "<jwt_access_token>",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "avatax_api"
}access_token can be used to interact with the API.access_token is valid for 1 hour, after which you will need to request a fresh token.Note: The sandbox API is only available for a fixed number of classification requests.