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

# Quickstart

> Create an API key and make your first call.

**1. Create an API key**

In StockShift, open **Settings > Access > API keys** and press **New API key**. Name it after the system that will use it, tick `catalog:read` and press **Create key**.

Copy the key straight away. It is shown once and never again.

**2. List your items**

Send the key as a bearer token. Paths are relative to `https://app.stockshift.io/api/v1`, and requests and responses are JSON.

```bash curl theme={null}
curl https://app.stockshift.io/api/v1/catalog/items \
  -H "Authorization: Bearer $STOCKSHIFT_TOKEN" \
  -H "Accept: application/json"
```

```ts TypeScript theme={null}
import { StockShift } from "@stockshift/sdk";

const stockshift = new StockShift({ token: process.env.STOCKSHIFT_TOKEN! });

for await (const item of stockshift.paginate("/catalog/items")) {
  console.log(item.sku, item.name);
}
```

```python Python theme={null}
import os

from stockshift import StockShift

with StockShift(token=os.environ["STOCKSHIFT_TOKEN"]) as stockshift:
    for item in stockshift.catalog.iter_items():
        print(item.sku, item.name)
```

```php PHP theme={null}
use StockShift\Sdk\StockShift;

$stockshift = new StockShift(getenv('STOCKSHIFT_TOKEN'));

$page = $stockshift->catalog()->listItems();
```

**3. Read the answer**

A list comes back one page at a time, with a cursor for the next page:

```json theme={null}
{
  "data": {
    "items": [{ "id": "01J8QZ4M...", "sku": "BOLT-M4", "name": "M4 hex bolt" }],
    "next_cursor": "eyJpZCI6IjAxSjhRWjRN..."
  }
}
```

Send `next_cursor` back as `after` to get the next page. The SDKs do this for you. See [Pagination](https://docs.stockshift.io/guides/pagination.md).

## Next

* Give each key only the scopes its job needs. [Permissions and scopes](https://docs.stockshift.io/guides/permissions-and-scopes.md) explains the two checks every call passes.
* Branch on the `code` of an error, not its text. See [Errors](https://docs.stockshift.io/guides/errors.md).
* Rather than polling for changes, [subscribe to webhooks](https://docs.stockshift.io/guides/webhooks.md).


## Related topics

- [.NET](https://docs.stockshift.io/sdks/dotnet.md)
- [Go](https://docs.stockshift.io/sdks/go.md)
- [PHP](https://docs.stockshift.io/sdks/php.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.