> ## Documentation Index
> Fetch the complete documentation index at: https://docs.archeraffiliates.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Exchange your Archer username and password for a bearer token.

Every API request, except the token request itself, needs an `Authorization`
header:

```txt theme={null}
Authorization: Bearer YOUR_ACCESS_TOKEN
```

## Get a token

Send your Archer username and password as `application/x-www-form-urlencoded`:

```bash theme={null}
curl -X POST https://api.archeraffiliates.com/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "username=YOUR_USERNAME&password=YOUR_PASSWORD"
```

The response includes `access_token`. Tokens are valid for **1440 minutes
(24 hours)** from issue — fetch a new one after that.

## Call the API

Pass the token as a bearer token:

```bash theme={null}
curl https://api.archeraffiliates.com/getproducts \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

<Tip>
  If a call returns `401`, fetch a fresh token and retry.
</Tip>

## Affiliate vs. seller access

The same token flow is used for both API surfaces. Your account determines
which endpoints you can call:

* An **affiliate** account can call the Affiliate API endpoints.
* A **seller** account can call the Seller API endpoints under `/sellers/...`.
