# Authenticate using Client ID and Client Secret

Source: https://developer.avalara.com/products/avalara-1099-and-w9/integration-guides/1099-and-w-9/fzg3425520933647/

Guide: 1099 & W-9

# **Authenticate using Client ID and Client Secret**

Authenticate with the Avalara 1099 & W-9 API using a client ID and client secret when your organization uses other Avalara products.

Use client credentials to authenticate with the Avalara 1099 & W-9 API. Create your client ID and client secret, then request a bearer token.

**Step 1: Create API credentials in Avalara 1099 & W-9 web application**

Note

Before you create API credentials in Avalara 1099 & W-9, enter a valid company address in the Accounts Settings > Account tab, and enable two-factor authentication in the Accounts Settings > Security tab.

1.  Select Account Settings in the top-right corner, then select API.
2.  Select Create new credentials.

    Note

    -   Authenticate using your 2FA security key to enable this option.
    -   A new Client ID and Client Secret are generated.

3.  Copy and store the credentials securely. These credentials are not visible again after you leave the screen.

**Step 2: Request a bearer token**

Make a `POST` request to the Avalara Identity service using the `client_credentials` grant type:

```
curl -X POST 'https://identity.avalara.com/connect/token' \
   --header 'Content-Type: application/x-www-form-urlencoded' \
   --data-urlencode 'grant_type=client_credentials' \
   --data-urlencode 'client_id={{client_id}}' \
   --data-urlencode 'client_secret={{client_secret}}'
```

This command sends a POST request to the Avalara Identity service. It specifies the headers and data needed to authenticate and retrieve an access token. Replace `{{client_id}}` and `{{client_secret}}` with your actual credentials.

Use the resulting bearer token to authenticate your API requests to the Avalara 1099 APIs.