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

# Quickstart

> Create a test payment and mount Lynq Checkout.

# Build your first test payment

Before you begin, create test API keys and configure at least one test payment method.

<Steps>
  <Step title="Create a Payment Intent on your server">
    Use your secret key and an idempotency key. Amounts use minor currency units: AMD 25,000.00 is `2500000`.

    ```ts theme={null}
    const response = await fetch("https://api.lynq.am/api/payment-intents", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.LYNQ_SECRET_KEY}`,
        "Content-Type": "application/json",
        "Idempotency-Key": `order:${order.id}`,
      },
      body: JSON.stringify({ amount: 2500000, currency: "AMD", orderId: order.id }),
    });
    const paymentIntent = await response.json();
    ```
  </Step>

  <Step title="Install and mount Checkout">
    ```bash theme={null}
    npm install @lynqpay/checkout-sdk
    ```

    ```ts theme={null}
    import { Checkout } from "@lynqpay/checkout-sdk";

    const checkout = new Checkout({
      publicKey: "pk_test_...",
      clientSecret: paymentIntent.clientSecret,
    });

    checkout
      .onPaymentResult(handlePaymentResult)
      .onCheckoutError(showCheckoutError)
      .mount("#lynq-checkout");
    ```
  </Step>

  <Step title="Verify the webhook">
    Configure a test webhook endpoint and fulfil the order only after a verified `payment_intent.succeeded` event. See [Verify webhooks](/build/webhooks).
  </Step>
</Steps>

Register handlers before `mount()`. The SDK supports one mounted Checkout iframe per page.
