> For the complete documentation index, see [llms.txt](https://docs.digitalriver.com/commerce-api-references/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalriver.com/commerce-api-references/warnings-and-error-codes/error-codes/error-codes-for-shopper-apis/401-unauthorized.md).

# 401 Unauthorized

The `401 Unauthorized` error code is an HTTP response status indicating that the server has not applied the request because it lacks valid authentication credentials for the target resource. This error signifies that the server refuses to grant access due to the absence of, or failure in, authentic credentials. If you encounter this error, you should ensure that your request includes the correct credentials and that you have permission to access the requested resource.

### `invalid_client`

The provided client is incorrect. Provide the correct client information and try again.

### `invalid_request`

The required parameter is missing or empty. Provide the missing parameter and try again.

### `invalid_token`

An invalid token for the shopper session indicates the token is no longer valid and must be refreshed to continue making API calls. This error occurs when there is a bad Dispatch token or Global Commerce User API token. To resolve this error, issue an API call to identify where the token originated and when it expired, for example:

`GET /oauth20/access-tokens?token=your_access_token HTTP/1.1 Host: api.digitalriver.com`

Where `your_access_token` is a placeholder for the actual token.

The response shows you where the token originated in the `domain` field and when it expired in the `expiresIn` field. The possible error descriptions are as follows:

* `Invalid token for specified shopper`

  The provided token is invalid for the specified shopper.
* `Session expired`–The shopper session is expired. Try refreshing the token.
* `Request Site ID does not match Token Site ID`

  The value of the Header `siteId` does not match the token's site ID.
* `Invalid Token for Shopper Session`

  The provided token is invalid. &#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalriver.com/commerce-api-references/warnings-and-error-codes/error-codes/error-codes-for-shopper-apis/401-unauthorized.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
