Skip to main content
This guide takes you from an order on your server to a mounted test checkout. It uses TypeScript and the npm package, but the same server API works from any backend language.

Before you begin

You need:
  • A Lynq Dashboard account
  • Card or Idram configured in Test mode
  • A test secret key and test publishable key
  • A backend route that your browser can call to start checkout
  • A page element where Checkout can mount
If you do not have these yet, see API keys and environments and Payment methods.

Store your test keys

Add the secret key to server-only configuration. The publishable key may be exposed to the browser.
.env
Do not commit the environment file. Expose the publishable key using the browser-safe configuration mechanism provided by your framework.

Create a Payment Intent on your server

Create one Payment Intent when the customer begins paying for an order. Build the amount and order ID from server-side order data instead of trusting values sent by the browser.
server/create-lynq-payment.ts
Amounts use minor currency units. For AMD 25,000.00, send 2500000. Reuse the same idempotency key only when retrying this exact create request.

Install the Checkout SDK

The package is ESM-only and includes TypeScript declarations. If your application does not use a bundler, see the script-tag installation.

Request the checkout session

From the browser, call your own backend route. Keep the secret key behind that route; return only the Payment Intent ID and client secret.
client/start-checkout.ts

Mount Checkout

Add an empty container to the page, register event handlers, and then mount Checkout.
client/mount-checkout.ts
Register handlers before mount(). Destroy the instance when the page is removed and create a new instance for a new Payment Intent.

Complete a test payment

Use the payment method you configured in Test mode. Confirm the browser shows a useful result and the payment appears under Dashboard → Payments.

Add authoritative fulfilment

Configure a test webhook endpoint, verify its signature, and update the order only after payment_intent.succeeded. See Verify webhooks.
The integration is complete when Checkout accepts a test payment and your verified webhook updates the matching order exactly once.
Continue with Payment Intents, Checkout events, and the test plan before switching to live mode.
Last modified on August 8, 2026