> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.lipafy.xyz/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.lipafy.xyz/_mcp/server.

# Create Your First Payment Intent

> Step-by-step tutorial executing your first payment intent using cURL, TypeScript SDK, or Lipafy CLI.

Executing a payment intent in Lipafy involves three simple steps: resolving a destination, submitting the intent with an idempotency key, and receiving real-time reconciliation.

---

### Method A: Using TypeScript / Node.js SDK

Install the official Lipafy SDK:

```bash
npm install @lipafy/sdk
```

```typescript
import { Lipafy } from '@lipafy/sdk'

const lipafy = new Lipafy({
  apiKey: process.env.LIPAFY_API_KEY!,
})

async function main() {
  // 1. Create a Payment Intent (e.g. Safaricom Home Fibre Renewal)
  const intent = await lipafy.payments.create({
    paymentType: 'PAYBILL_PAYMENT',
    paybill: '150501',
    accountReference: '0722123456',
    amountMinor: '300000', // KES 3,000.00
    currency: 'KES',
    purpose: 'Monthly Home Fibre Renewal',
  })

  console.log(`Payment Status: ${intent.status}`)
  console.log(`Tracking ID: ${intent.id}`)
}

main().catch(console.error)
```

---

### Method B: Using cURL

```bash
curl -X POST https://api.lipafy.xyz/v1/payment-intents \
  -H "Authorization: Bearer lip_live_your_api_key" \
  -H "Idempotency-Key: fibre-renewal-2026-08" \
  -H "Content-Type: application/json" \
  -d '{
    "payment_type": "PAYBILL_PAYMENT",
    "paybill": "150501",
    "account_reference": "0722123456",
    "amount_minor": "300000",
    "currency": "KES",
    "purpose": "Monthly Home Fibre Renewal"
  }'
```

**Response (`201 Created`):**

```json
{
  "id": "pi_9f83a2bc-d14e-4b92-8051-18239014819a",
  "status": "SUCCEEDED",
  "amount_minor": "300000",
  "fee_minor": "0",
  "currency": "KES",
  "network_receipt": "QHK892N1P",
  "destination": "PayBill 150501 (Ref: 0722123456)",
  "purpose": "Monthly Home Fibre Renewal",
  "created_at": "2026-08-17T00:00:00Z"
}
```

---

### Method C: Using Lipafy CLI

You can execute transfers and checks directly from your terminal:

```bash
# Instant P2P @tag transfer
npx lipafy transfer --to "@alice" --amount 1500 --note "Dinner split"

# Pay a verified PayBill
npx lipafy pay --paybill 150501 --account "0722123456" --amount 3000 --purpose "Fibre renewal"

# Check wallet balance and active spending policy
npx lipafy whoami
```