kite~/kite/docs
v0.2.1
Tutorial

Your First Webhook

Create a Stripe source, stream events to your terminal, and inspect a full CloudEvent payload — no local server, no tunnels.

Create a Stripe source, stream events to your terminal, and inspect a full CloudEvent payload — no local server, no tunnels.

// 01Prerequisites

  • Kite CLI installed (Installation guide)
  • A Stripe account (free, no card needed for test mode)

// 02Install & log in

If you haven't installed Kite yet, run:

bash
curl -fsSL https://getkite.sh/install | sh
kite login

kite login opens a browser tab for device auth. Agents can skip this — see the x402 bootstrap guide.

// 03Create a Stripe endpoint

Register a Stripe source. Kite prints a webhook URL you'll paste into Stripe.

bash
kite endpoints create --source stripe

Output includes a webhook_url like https://hooks.getkite.sh/e/<id>. Copy it.

// 04Point Stripe at Kite

  • Open the Stripe DashboardDevelopersWebhooksAdd endpoint.
  • Paste your Kite webhook URL and select events to listen for (e.g. payment_intent.succeeded).
  • Save the endpoint.

Already have events? Any HTTPS sender works — just replace the Stripe URL with your Kite endpoint.

// 05Stream events to your terminal

Start streaming. Filter to Stripe so you only see relevant events:

bash
kite stream --source stripe

Add --json for full CloudEvent payloads. Add --compact for one-liners.

// 06Trigger a test event

In the Stripe Dashboard, click Send test webhook on your endpoint. Or send one directly with curl:

bash
curl -X POST https://hooks.getkite.sh/e/<your-endpoint-id> \
  -H "content-type: application/json" \
  -d '{"type":"payment_intent.succeeded","data":{"amount":4200}}'

Replace <your-endpoint-id> with the ID from the Stripe endpoint step.

// 07Inspect the CloudEvent payload

Re-run with --json to see the full payload:

bash
kite stream --source stripe --json

Each event arrives as a CloudEvent v1.0 envelope:

json
{
  "specversion": "1.0",
  "id":          "evt_3OxABC...",
  "source":      "stripe",
  "type":        "com.stripe.payment_intent.succeeded",
  "time":        "2026-04-08T10:00:00Z",
  "datacontenttype": "application/json",
  "data": {
    "type":   "payment_intent.succeeded",
    "data":   { "amount": 4200, "currency": "usd" },
    "livemode": false
  }
}

// 08For AI agents

Agents can receive webhooks without a browser login. Use the listen command with a Unix socket, or bootstrap credentials via x402.

Unix socket (MCP / local agent)

bash
kite listen --socket /tmp/kite-stripe.sock --source stripe

Your agent reads structured events from the socket. Works with any MCP or OpenClaw agent that supports Unix socket I/O.

x402 bootstrap (headless auth)

bash
curl -X POST https://api.getkite.sh/api/v1/bootstrap/x402 \
  -H 'content-type: application/json' \
  -d '{"source":"stripe","deposit_atomic":1000000,"plan":"starter"}'

Returns credentials your agent can use to call kite stream immediately. See the x402 bootstrap guide.

// 09What's next