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

# Quickstart

> Register an app, install it on a store, and make your first Admin API call.

**1. Register your app**

In the EasyOrders developer dashboard, create an app. Set:

* a **redirect URL**, e.g. `http://localhost:3000/auth/callback` while you develop;
* the **scopes** your app needs, e.g. `read_orders` and `read_shipping`.

Copy the `client_id` and the `client_secret`. The secret is shown once.

```bash theme={"dark"}
export EASYORDERS_CLIENT_ID="eo_cid_..."
export EASYORDERS_CLIENT_SECRET="eo_sec_..."
```

**2. Send the merchant to the consent page**

Build a PKCE pair and a `state`, then redirect the merchant (or yourself, on your own test store):

```text theme={"dark"}
https://DASHBOARD-HOST/oauth/authorize?response_type=code&client_id=eo_cid_...&redirect_uri=http://localhost:3000/auth/callback&scope=read_orders%20read_shipping&state=xyz123&code_challenge=...&code_challenge_method=S256
```

See [Authentication](https://developers-docs.easyorders.ai/authentication.md#1-send-the-merchant-to-the-consent-page) for building `code_challenge`.

**3. Exchange the code**

EasyOrders redirects back with `?code=eo_code_...&state=xyz123`. Within one minute, exchange it from your server:

```bash theme={"dark"}
curl -X POST "https://api.easy-orders.net/oauth/token" \
  -H "Content-Type: application/json" \
  -d '{
  "grant_type": "authorization_code",
  "client_id": "'"$EASYORDERS_CLIENT_ID"'",
  "client_secret": "'"$EASYORDERS_CLIENT_SECRET"'",
  "code": "eo_code_...",
  "redirect_uri": "http://localhost:3000/auth/callback",
  "code_verifier": "..."
}'
```

Keep the `access_token`, `refresh_token` and `store_id` from the answer.

```bash theme={"dark"}
export EASYORDERS_ACCESS_TOKEN="eo_at_..."
```

**4. Make your first call**

Read the store's shipping settings:

```bash theme={"dark"}
curl "https://api.easy-orders.net/api/partners-apps/v1/shipping/settings" \
  -H "Authorization: Bearer $EASYORDERS_ACCESS_TOKEN"
```

```json theme={"dark"}
{
  "shipping_settings": {
    "enabled": true,
    "country": { "code": "EG", "name_ar": "مصر", "name_en": "Egypt" },
    "cost_type": "per_area",
    "fixed_cost": 0
  }
}
```

Then list the last orders:

```bash theme={"dark"}
curl -G "https://api.easy-orders.net/api/partners-apps/v1/orders" \
  --data-urlencode "limit=5" \
  -H "Authorization: Bearer $EASYORDERS_ACCESS_TOKEN"
```

## Next

> [card] [Refresh tokens](https://developers-docs.easyorders.ai/authentication.md#refresh-the-access-token)
>
> Access tokens last one hour. Refresh them, once each.

> [card] [Errors](https://developers-docs.easyorders.ai/concepts/errors.md)
>
> One error shape, and stable codes to branch on.


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