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

# Getting started

> Take a payment and react to it in about ten minutes.

Take a payment and react to it in about ten minutes. You will create a product, create an API key, send a buyer to checkout and handle the webhook.

> [!TIP]
>
> **Using a coding agent?**
>
> Skip the manual steps: [Set up SleetPay with an AI agent](https://docs.sleetpay.com/guides/agents.md) gives it a playbook and tells you which dashboard steps to do.

## 1. Create an account and a product

Sign up at [app.sleetpay.com](https://app.sleetpay.com), confirm your email and create an organization. The setup wizard asks for your country and currency and creates a first product. Note its id (`prod_...`) from **Dashboard > Products**.

> [!TIP]
>
> **You can sell before you are verified**
>
> Money accrues in your balance from the first sale. Withdrawals unlock once Stripe has verified your identity and bank account: **Finance > Verify with Stripe & get paid**.

## 2. Create an API key

**Dashboard > API keys > Create.** Give it only the scopes this server needs. For this walkthrough that is `checkouts:write` and `customers:read`.

```bash theme={null}
export SLEETPAY_API_KEY=sk_live_...
```

Treat it like a password: server-side only, never in a browser or mobile app. See [Authentication](https://docs.sleetpay.com/guides/authentication.md).

## 3. Send a buyer to checkout

```bash curl theme={null}
curl -X POST https://app.sleetpay.com/api/v1/checkouts \
  -H "Authorization: Bearer $SLEETPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"prod_...","external_customer_id":"user_42","success_url":"https://yourapp.com/welcome?checkout={CHECKOUT_ID}"}'
```

```ts TypeScript theme={null}
import { SleetPay } from "@sleetpay/sdk";

const sleetpay = new SleetPay({ apiKey: process.env.SLEETPAY_API_KEY });
const checkout = await sleetpay.checkouts.create({
  productId: "prod_...",
  externalCustomerId: "user_42", // your own user id
  successUrl: "https://yourapp.com/welcome?checkout={CHECKOUT_ID}",
});
```

```python Python theme={null}
import os
from sleetpay import SleetPay

sleetpay = SleetPay(api_key=os.environ["SLEETPAY_API_KEY"])
checkout = sleetpay.checkouts.create(
    "prod_...",
    external_customer_id="user_42",
    success_url="https://yourapp.com/welcome?checkout={CHECKOUT_ID}",
)
```

The response contains a `url`. Redirect the buyer there. After payment they land on your `success_url`.

## 4. Handle the webhook

Do not unlock access from the redirect alone. Wait for the signed webhook: **Dashboard > Webhooks > Add endpoint**, pick `order.paid` and `subscription.created`, and copy the signing secret.

```ts theme={null}
import { constructEvent } from "@sleetpay/sdk";

export async function POST(req: Request) {
  const raw = await req.text(); // the RAW body
  const event = await constructEvent(process.env.SLEETPAY_WEBHOOK_SECRET!, raw, req.headers);
  if (event.type === "order.paid") {
    // grant access using event.data
  }
  return new Response("ok");
}
```

Details, retries and de-duplication: [Webhooks](https://docs.sleetpay.com/guides/webhooks.md).

## 5. Check what a customer owns

Because you passed `external_customer_id`, you can ask for entitlements by your own user id at any time:

```ts theme={null}
const state = await sleetpay.customers.stateByExternalId("user_42");
const isPro = state.active_subscriptions.some((s) => s.product_id === PRO_PRODUCT_ID);
```

## Next

* [Accept a payment](https://docs.sleetpay.com/guides/checkout.md): currencies, discounts, seats, pay-what-you-want
* [Subscriptions](https://docs.sleetpay.com/guides/subscriptions.md)
* [Going live](https://docs.sleetpay.com/guides/going-live.md)
* [API reference](https://docs.sleetpay.com/api-reference/introduction.md)


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