Skip to content

Latest commit

 

History

History
148 lines (119 loc) · 5.17 KB

File metadata and controls

148 lines (119 loc) · 5.17 KB
title Introduction
description Accept crypto payments on Solana with seven lines of code. Built for developers who ship fast.

Welcome to ZendFi

ZendFi is a payment infrastructure platform built on Solana. It gives you everything you need to accept stablecoin and token payments -- subscriptions, invoices, installment plans, payment links, embedded checkout, and more -- through a single, clean API.

No wallet custody. No smart contract deployments. No blockchain plumbing.

You write createPayment({ amount: 50 }), and ZendFi handles the rest.

Go from zero to accepting payments in under five minutes. Full endpoint documentation with request/response examples. TypeScript SDK with zero-config setup and type-safe helpers. Scaffold projects, test payments, and manage keys from your terminal. Policy-driven delegation, execution intents, triggers, and balance automation.

What You Can Build

Accept USDC, USDT, or SOL with automatic settlement to your wallet. Recurring billing with configurable intervals, trial periods, and automated collection. Shareable checkout URLs with hosted pages -- no frontend required. Professional invoicing with email delivery and payment tracking. Split purchases into scheduled payments with automatic reminders. Route funds to multiple recipients in a single transaction. Perfect for marketplaces.

How It Works

At a high level, every ZendFi payment follows this flow:

sequenceDiagram
    participant App as Your App
    participant API as ZendFi API
    participant Chain as Solana
    participant Webhook as Your Webhook

    App->>API: Create payment
    API-->>App: Payment ID + checkout URL
    Note over App: Customer pays via<br/>checkout or direct transfer
    Chain->>API: Transaction detected
    API->>API: Verify + settle
    API->>Webhook: payment.confirmed event
    Webhook-->>API: 200 OK
Loading
  1. Your application creates a payment through the API or SDK.
  2. The customer completes payment via the hosted checkout, embedded checkout, or a direct Solana transfer.
  3. ZendFi monitors the blockchain, verifies the transaction, and settles funds to your merchant wallet.
  4. Your webhook endpoint receives a payment.confirmed event so you can fulfill the order.

Core Principles

Non-custodial by default. ZendFi never holds your funds. Payments settle directly to your Solana wallet. You maintain full control of your keys.

Test and live modes. Every API key is scoped to either test (Solana devnet) or live (Solana mainnet). Switch between them by swapping your API key -- the code stays the same.

Gasless transactions. Customers can pay without holding SOL for gas fees. ZendFi sponsors the transaction fees so your checkout flow is frictionless.

Idempotent by design. The SDK automatically generates idempotency keys for write operations. Retries are safe by default.

Quick Example

import { zendfi } from '@zendfi/sdk';

const payment = await zendfi.createPayment({
  amount: 50,
  description: 'Pro Plan - Monthly',
  customer_email: 'customer@example.com',
});

// Redirect to hosted checkout
redirect(payment.payment_url);
import { zendfi } from '@zendfi/sdk';

app.post('/api/checkout', async (req, res) => {
  const payment = await zendfi.createPayment({
    amount: req.body.amount,
    description: req.body.description,
  });

  res.json({ checkout_url: payment.payment_url });
});
curl -X POST https://api.zendfi.tech/api/v1/payments \
  -H "Authorization: Bearer zfi_test_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50,
    "currency": "USD",
    "description": "Pro Plan - Monthly"
  }'

Next Steps

Sign up at [dashboard.zendfi.tech](https://dashboard.zendfi.tech) and grab your test key. It starts with `zfi_test_`. The [Quickstart guide](/quickstart) walks you through a complete integration in under five minutes. Configure a webhook endpoint to receive real-time payment notifications. See the [Webhooks guide](/api-reference/webhooks). Swap your test key for a live key (`zfi_live_`), and you are processing real payments on Solana mainnet.