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

# Quickstart

> Shop live and sellable in five calls.

## 1 · Get an API token

In the Alyte console: **API keys → Mint**, scopes `merchant:read` + `merchant:write`.
The token is shown once — keep it server-side; never ship it to a browser.

## 2 · Install the SDK

```bash theme={null}
npm install @alyte/sdk   # zero dependencies, Node ≥ 18
```

(Or call the REST API directly — the SDK is a thin typed client over it.)

## 3 · Onboard

```ts theme={null}
import { AlyteMerchant } from '@alyte/sdk';

const alyte = new AlyteMerchant({ baseUrl: ALYTE_URL, token: process.env.ALYTE_API_TOKEN });

// Your shop — your settlement identity. Money lands on YOUR PSP, never Alyte's.
const { merchant } = await alyte.createShop({ name: 'Nova Live', geo: 'DE', currency: 'EUR' });

// Your own Stripe. The secret key is vaulted immediately — only an opaque
// reference is ever stored or returned. The publishable key powers the
// buyer card-capture iframe.
await alyte.linkPsp(merchant.id, {
  psp: { id: 'stripe', name: 'Stripe' },
  isDefault: true,
  secret: process.env.MY_STRIPE_SECRET_KEY,
  publishableKey: process.env.MY_STRIPE_PUBLISHABLE_KEY,
});

// Inventory. priceMinor is integer cents: 4900 = €49.00. Floats are refused.
const { event } = await alyte.createEvent({
  merchantId: merchant.id, title: 'Nova Live — Warsaw', startsAt: '2026-11-04T19:00:00Z',
});
const { tier } = await alyte.createTier({
  eventId: event.id, title: 'General admission',
  priceMinor: 4900, currency: 'EUR', kind: 'general', availableCount: 500,
});
```

<Warning>
  **Scheduling a drop is a separate call.** Tier *restrictions* — `onSaleStart`,
  `onSaleEnd`, `maxQtyPerPurchase`, allowed geos and schemes — are set by updating
  the tier, not when creating it. Passing them to create is currently ignored
  without an error, so the tier goes on sale **immediately**:

  ```ts theme={null}
  // Create first, then set the window.
  await alyte.updateTier(tier.id, { onSaleStart: '2026-10-01T09:00:00Z' });
  ```

  Run [the self-test](/guides/self-test) afterwards — `catalog_sellable` tells you
  whether the tier is buyable now or correctly waiting for its drop.
</Warning>

## 4 · Send a buyer to authorize their agent

If your users are already signed in with **your** auth, attest them — no email round-trip:

```ts theme={null}
const s = await alyte.buyerSessions.mint({ merchantId: merchant.id, email: user.email });
res.redirect(ALYTE_URL + s.redeemPath);   // single-use link, 15-minute TTL
```

They land on the shop's authorize page: pick or bring an agent, set a spending
cap. Alyte enforces that cap server-side on every purchase the agent attempts.

## 5 · Watch the money arrive

Payments settle on your PSP. Alyte gives you the audit trail:

```ts theme={null}
const { payments } = await alyte.listPayments();
```

That's the whole loop. For agent-side integration (discover → quote → hold →
confirm), see the API reference — the same flow the `AlyteAgent` client wraps.
