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

# Quick start

> From a new key to your own products, read back by your own server

**1. Make a key**

In the dashboard, open **Developers**, then **API Keys**, and press **Add API Key**. Name it after what will use it, tick the permissions that thing needs (for this page, **Read products**), and save.

The key starts `shoply_sk_` and is shown once. It belongs where your server keeps its secrets, and nowhere a browser or a repository can read it.

**2. Ask the key what it is**

A key is all you need to begin: it knows which store it belongs to.

```bash cURL theme={null}
curl https://api.shoply.gg/v1/key \
  -H "Authorization: Bearer $SHOPLY_KEY"
```

```javascript Node.js theme={null}
const response = await fetch("https://api.shoply.gg/v1/key", {
  headers: { Authorization: `Bearer ${process.env.SHOPLY_KEY}` },
});

const { data } = await response.json();

console.log(data.store.id, data.key.scopes);
```

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

answer = requests.get(
    "https://api.shoply.gg/v1/key",
    headers={"Authorization": f"Bearer {os.environ['SHOPLY_KEY']}"},
).json()

print(answer["data"]["store"]["id"], answer["data"]["key"]["scopes"])
```

```php PHP theme={null}
$curl = curl_init('https://api.shoply.gg/v1/key');

curl_setopt_array($curl, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer ' . getenv('SHOPLY_KEY')],
]);

$answer = json_decode(curl_exec($curl), true);

echo $answer['data']['store']['id'];
```

The answer names the key, its permissions, and the store with its ID. `api` is where that store's routes begin.

```json theme={null}
{
  "success": true,
  "message": null,
  "code": null,
  "data": {
    "key": { "name": "Order sync", "scopes": ["products.read"], "allowedIps": [], "allowedDomains": [], "expiresAt": null },
    "store": { "id": "8d0a0f6e-3f0b-4c57-9a55-0c1f3f5d7a10", "name": "Northwind Keys", "slug": "northwind" },
    "api": "https://api.shoply.gg/v1/stores/8d0a0f6e-3f0b-4c57-9a55-0c1f3f5d7a10"
  }
}
```

**3. Read your products**

```bash theme={null}
curl https://api.shoply.gg/v1/stores/$STORE_ID/products \
  -H "Authorization: Bearer $SHOPLY_KEY"
```

`data` is the list. Each product has its variants, and each variant its ID, price and how many license keys it has in stock.

## Next

> **[Add stock](/api-reference/stock/add-license-keys.md)**
>
> Send a variant its license keys.

> **[Hear about paid orders](/api-reference/webhooks.md)**
>
> Add a webhook for `order.paid` instead of asking.

> **[Raise an invoice](/api-reference/invoices/create-an-invoice.md)**
>
> Make an order for a buyer and get the page to pay it on.

> **[Send a change safely](/api-reference/idempotency.md)**
>
> Make a retry do nothing twice.


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