Get started
Quickstart
Create a sandbox, publish a product and generate your first payment link.
Start with a test key. Sandbox payments do not move real money. Keep secret keys on your server, never in a browser bundle or source control.
Integrating with an AI agent? Start with agent onboarding. It collects your email, app name and billing intent, then prepares the environment and returns a link to finish registration in Infi.
1. Create a sandbox
In a new project directory, run:
npx -y @beinfi/cli bootstrap --intent one-time --ref docs --jsonThe CLI provisions a sandbox, writes infi.company.ts and .env.local,
syncs an example one-time product with a published version, and runs its checks.
Review the generated catalog and price before using it.
Save the returned claim URL: opening it lets you claim ownership of the tenant.
The default claim window is 30 days; use the returned expiresAt as the deadline.
Do not commit the generated secret key. With the claim-email update, provisioning
with an email also queues the claim link for delivery, at most once per address
every 24 hours. Always keep the returned link; provisioning success does not
confirm email delivery. The bootstrap command above does not supply an email.
If you only need a sandbox key, without generating project files:
npx -y @beinfi/cli claim create --jsonThat second command does not give you a ready-to-sell product. The seed product is a draft; create and publish your own product before creating a payment link. The detailed catalog guide has the three calls.
2. Install the SDK
npm install @beinfi/sdkLoad INFI_SECRET_KEY and INFI_TENANT_SLUG from the generated environment
file in your server runtime. Then:
import { Infi } from "@beinfi/sdk";
const infi = new Infi({
secretKey: process.env.INFI_SECRET_KEY!
});
const products = await infi.products.list();Test keys (sk_test_) select the sandbox API and checkout. Live keys
(sk_live_) select production. You do not need to set a base URL.
3. Create a payment link
After the one-time bootstrap, use the published item product:
const product = products.find((entry) => entry.key === "item");
if (!product?.id) throw new Error("Publish the example product first.");
const { url } = await infi.links.create(product.id, {
slug: process.env.INFI_TENANT_SLUG!
});
console.log(url);Open the returned URL. The customer and invoice are created when the buyer submits checkout. A payment link is not proof that a payment succeeded.
The route is selected at payment time from compatible providers. For live payments, connect your own supported provider account first.
4. Confirm the result
In the sandbox, use the test checkout and poll the invoice. Once you have the invoice ID:
const paid = await infi.pay.waitForPaid({
slug: process.env.INFI_TENANT_SLUG!,
invoiceId
});true means the invoice is paid; false means polling timed out. Use
signed webhooks for production. Sandbox webhook registration
currently depends on a secret store that may be unavailable; polling is the
documented sandbox path.
5. Go live
Claim your tenant, connect a provider account, register your webhook endpoint and use a live key. Check provider status in your dashboard before accepting payments.
Existing saved cards, subscriptions and provider-specific code are not
automatically migrated when you connect a provider. The Stripe-compatible SDK
is a separate Early access surface; the examples here use @beinfi/sdk.
Read the SDK guide for idempotency and the HTTP API reference if you use another language.