# Test AvaTax connection

Source: https://developer.avalara.com/ecommerce-integration-guide/designing/test-avatax-connection/

**Element type:** Conditional

**Endpoints/models used:** [Ping API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Utilities/Ping/), [QueryCompanies API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Companies/QueryCompanies/)

If a method to look up companies isn't available on your admin page, then you must include a button that allows users to test the connection to the AvaTax calculation service and verify the credentials. This is an important element to allow for successful troubleshooting of the AvaTax calculation service. This button can call either the [Ping API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Utilities/Ping/), as described earlier in this document, or it can point to the [QueryCompanies](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Companies/QueryCompanies/) API.

**Advice**: Testing credentials with the [QueryCompanies API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Companies/QueryCompanies/) is a best practice for integrations that support multiple filing entities. This API allows merchants to determine which company profile within their account they want to process a transaction against and post a transaction to. If the query is successful, the API will return a listing of all the companies that a merchant has configured in their account. (Ideally, this should be presented in a dropdown for the user.) If the API fails, then present an authentication failure.