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

# Quickstart

> Get a token, find a store, and mark an item sold out.

This walkthrough uses the sandbox. Sandbox credentials are issued when your integration is set up, together with sample stores, products, and a simulated order stream.

## 1. Get an access token

```bash theme={null}
curl -X POST https://sandbox.api.lulacommerce.com/v1/oauth/token \
  -d grant_type=client_credentials \
  -d client_id=$LULA_CLIENT_ID \
  -d client_secret=$LULA_CLIENT_SECRET \
  -d scope="stores:read catalog:read availability:write"
```

```json theme={null}
{
  "access_token": "eyJhbGciOiJSUzI1NiIs...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "stores:read catalog:read availability:write"
}
```

## 2. Find a store by your store number

```bash theme={null}
curl "https://sandbox.api.lulacommerce.com/v1/stores?external_id=0142" \
  -H "Authorization: Bearer $TOKEN"
```

You can also use your store number directly anywhere a `store_id` is expected, prefixed with `ext:`, for example `/stores/ext:0142`.

## 3. Mark an item sold out

```bash theme={null}
curl -X POST https://sandbox.api.lulacommerce.com/v1/availability \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1d2c1e-8a4b-4c55-9d0e-2b7a1f3c9e10" \
  -d '{
    "external_ids": ["028400090858"],
    "store_ids": ["ext:0142"],
    "available": false,
    "reason": "out_of_stock"
  }'
```

```json theme={null}
{
  "id": "avl_01J9ZQ4K7R2W",
  "status": "propagating",
  "available": false,
  "reason": "out_of_stock",
  "stores_affected": 1,
  "items_affected": 1,
  "channels": [
    { "channel": "lula_direct", "status": "applied", "applied_at": "2027-03-01T15:02:11Z" },
    { "channel": "doordash", "status": "pending", "applied_at": null },
    { "channel": "ubereats", "status": "pending", "applied_at": null },
    { "channel": "grubhub", "status": "pending", "applied_at": null }
  ]
}
```

## 4. Confirm it landed everywhere

Poll `GET /availability/{change_id}` or, better, subscribe to `item.availability_changed` and receive one event per store and channel as each one applies. See [Webhooks](https://platform.lulacommerce.com/concepts/webhooks.md).

## Next

* [Real-time availability](https://platform.lulacommerce.com/guides/real-time-availability.md) covers chain-wide changes, scheduled return to stock, and channel targeting.
* [Orders to your kitchen](https://platform.lulacommerce.com/guides/orders-to-kitchen.md) covers receiving and fulfilling orders.


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