> ## 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.

# Authentication

> Client credentials, access tokens, and scopes.

The Lula Commerce API uses the OAuth 2.0 client credentials grant. Each integration receives a client ID and client secret per environment. Exchange them for a short-lived access token and send the token on every request.

```http theme={null}
Authorization: Bearer eyJhbGciOiJSUzI1NiIs...
```

## Credentials

* Credentials are issued per company and per environment (sandbox and production).
* You can hold several credentials at once, for example one for your pricebook integration and one for your kitchen system, each with only the scopes it needs.
* Rotate a secret at any time. The previous secret keeps working for 24 hours so you can roll it out without downtime.
* Never put client secrets in browser or mobile app code.

## Access tokens

Tokens are signed JWTs valid for 60 minutes. Request a new token before the current one expires; there is no refresh token in the client credentials grant. Cache the token and reuse it across requests rather than requesting one per call.

## Scopes

Request scopes as a space-separated list in the `scope` field. A request made without the required scope returns `403` with `type: permission_error`.

| Scope | Grants |
| - | - |
| `stores:read` | Stores, status, hours, channel state |
| `stores:write` | Pause and resume, set hours, enable or disable channels |
| `catalog:read` | Products, store items, menus, modifier groups, recalls, jobs |
| `catalog:write` | Create and update products, store items, modifier groups |
| `availability:write` | Change item availability, create and lift recalls |
| `orders:read` | Orders |
| `orders:write` | Accept, reject, adjust, mark ready, complete, cancel |
| `reports:read` | Sales, reconciliation, payouts, exports, data feeds |
| `webhooks:manage` | Webhook endpoints |

## Store-level access

By default a credential can act on every store in your company. A credential can also be limited to a list of stores, which is useful when a franchisee or regional system integrates directly. Requests for other stores return `404`.

## Errors

| Status | Meaning |
| - | - |
| `401` | Token missing, expired, or invalid. Request a new token. |
| `403` | Token valid but missing the scope or store access for this request. |


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