laso

← All agent guides

How do I get notified when my AI agent spends money?

Last reviewed: August 2026

The short answer

Register a webhook with POST /register-webhook. Every account notification, including card orders, bank transfers, payouts, withdrawals and deposits, is then POSTed to your URL as a signed JSON request, in addition to push, SMS, Telegram and in-app alerts for the account owner. If your agent cannot receive inbound HTTP, poll GET /get-account-balance and the status endpoints instead.

Two ways to find out what an agent spent

An alert you have to remember to check is not an alert. There are two patterns, and they work together. Push delivers an event the moment it happens. Polling reads the current state on a timer and is the source of truth when a delivery is missed.

Push or poll, and where each one fits.
MethodHow it worksBest for
WebhookLaso POSTs a signed notification to your HTTPS URLReacting immediately: pause the agent, message a human, write to a log
Owner channelsPush, SMS, Telegram and in-app alerts go to the account ownerA human watching their own agent
PollingGET /get-account-balance, GET /list-card-transactions, GET /get-payment-statusAgents that cannot receive inbound HTTP, and reconciliation

Step 1: Register a webhook

Sign in to get an id_token, then register a public HTTPS URL. The signing secret is returned once, so store it immediately.

curl -X POST https://laso.finance/register-webhook \
  -H "Authorization: Bearer $LASO_ID_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://agent.example.com/hooks/laso"}'
# {
#   "registered": true,
#   "url": "https://agent.example.com/hooks/laso",
#   "secret": "whsec_...",
#   "signing": "standard-webhooks"
# }

There is one webhook per account. Registering again replaces the URL, rotates the secret and re-enables a registration that was disabled. Registering also sends a first signed test delivery of type notification.account and tells the account owner through their other channels that an agent registered a webhook.

Step 2: Verify and handle deliveries

Each delivery is a JSON POST. The type is notification. plus the category, and the categories include account, transaction, deposit, withdrawal, card, giftCard, refund and balanceUpdate.

{
  "type": "notification.transaction",
  "timestamp": "2026-07-31T18:04:05.000Z",
  "data": {
    "user_id": "usr_abc123",
    "title": "Bank transfer complete",
    "text": "$250.00 landed in your agent wallet.",
    "category": "transaction"
  }
}

Deliveries follow the Standard Webhooks specification, so any standard-webhooks library can verify them. The headers are webhook-id, webhook-timestamp and webhook-signature. This Node handler verifies the signature, rejects stale timestamps and acknowledges quickly.

import express from "express";
import { createHmac, timingSafeEqual } from "crypto";

const SECRET = process.env.LASO_WEBHOOK_SECRET; // whsec_...
const app = express();

app.post("/hooks/laso", express.raw({ type: "application/json" }), (req, res) => {
  const id = req.header("webhook-id");
  const timestamp = req.header("webhook-timestamp");
  const presented = req.header("webhook-signature");
  const key = Buffer.from(SECRET.slice("whsec_".length), "base64");
  const expected =
    "v1," +
    createHmac("sha256", key)
      .update(`${id}.${timestamp}.${req.body}`)
      .digest("base64");

  const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) < 300;
  const valid =
    presented.length === expected.length &&
    timingSafeEqual(Buffer.from(presented), Buffer.from(expected));
  if (!valid || !fresh) {
    return res.sendStatus(401);
  }

  res.sendStatus(200); // acknowledge within 10 seconds, then process
  const event = JSON.parse(req.body);
  console.log(event.type, event.data.title, event.data.text);
});

app.listen(3000);

Deliveries time out after 10 seconds and are not retried. After 50 consecutive failures the registration is disabled. Treat the webhook as a low-latency hint and the status endpoints as the record.

Step 3: Check delivery health

curl https://laso.finance/get-webhook \
  -H "Authorization: Bearer $LASO_ID_TOKEN"
# { "registered": true, "disabled": false, "consecutive_failures": 0,
#   "last_delivery_status": "delivered", "last_delivery_detail": "HTTP 200", ... }

If disabled is true, fix the receiver and register again. POST /delete-webhook removes the registration; the owner keeps receiving alerts on their other channels.

No inbound HTTP? Poll instead

An agent running on a laptop or inside a sandbox often cannot receive a POST. Point the webhook at a relay or queue you can drain, or read the state directly:

curl "https://laso.finance/list-card-transactions?limit=10" \
  -H "Authorization: Bearer $LASO_ID_TOKEN"

What this does not do

Full reference: receive notifications by webhook, POST /register-webhook and GET /get-account-balance.

Frequently asked questions

How do I get an alert when my AI agent makes a purchase?

Register a webhook with POST /register-webhook. Card orders, gift card orders, payouts and withdrawals arrive as signed notification POSTs, and the account owner also gets push, SMS, Telegram and in-app alerts.

How do I verify a webhook really came from Laso?

Check the webhook-signature header, an HMAC-SHA256 of the webhook-id, webhook-timestamp and raw body keyed with your whsec_ secret. Any Standard Webhooks library does this, and you should reject timestamps more than a few minutes old.

What if my agent cannot receive webhooks?

Poll GET /get-account-balance and GET /list-card-transactions on a timer, or point the webhook at a relay or queue your agent can read.

Does Laso retry failed webhook deliveries?

No. Deliveries time out after 10 seconds, and the registration is disabled after 50 consecutive failures. Use GET /get-webhook to check health and register again to re-enable it.

Can I stop my agent from overspending instead of just being told?

Yes. The account owner sets a per-payment spend limit the agent cannot change, and each payment can carry a maxAmountUsdc cap.

More guides

Try it: connect a wallet at laso.finance and you'll have a card, gift card, or payout in minutes.

Building an agent? Point it at laso.finance/SKILL.md — it can set itself up.