> For the complete documentation index, see [llms.txt](https://help.orderdesk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.orderdesk.com/api-documentation/getting-started/authentication.md).

# Authentication

In order to connect to the Order Desk API, go to your [Store Settings](/guided-walkthroughs/using-order-desk/manage-store-settings.md#api) and click on the API tab to create an API Key. You'll be presented with an API Key and Store ID. You'll need to add both of these details as headers to each request that you make to the API, along with the correct content type.

### Required Headers

| Name                 | Value         |
| -------------------- | ------------- |
| `ORDERDESK-STORE-ID` | Your store ID |
| `ORDERDESK-API-KEY`  | Your API key  |

Include `Content-Type: application/json` on requests that send a JSON body.

### Testing Your Connection

Query the testing endpoint to confirm that your credentials are working.&#x20;

`GET /https://app.orderdesk.me/api/v2/test`

```shell
curl "https://app.orderdesk.me/api/v2/test" \
  -H "ORDERDESK-STORE-ID: your-store-id" \
  -H "ORDERDESK-API-KEY: your-api-key"
```

A working connection returns `200` with a `status` of `success`:

```json
{
  "status": "success",
  "message": "Connection Successful",
  "current_date_time": "2015-04-14 22:00:10",
  "execution_time": "0.0121 seconds"
}
```

{% hint style="danger" %}
Please note that sending an invalid Store ID will block your store from the API rather than simply returning an error. Confirm that your Store ID is correct before running a script that retries. See Errors for details.
{% endhint %}

### Keeping Your API Key Secure

An API key grants full read and write access to the store, including customer addresses and order history. It should be kept on your server and should not be included in browser JavaScript, mobile application binaries, or public repositories.

If a key is exposed, generate a new one from the same API tab. The previous key stops working immediately.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.orderdesk.com/api-documentation/getting-started/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
