SDK / API ReferencePayments
Activity
Bank-statement-style merged feed of payments sent and received
Scope: none — the authenticated Identity can always see its own payment history.
Returns a single chronological feed (latest first) merging payments received (direction: "in") and sent (direction: "out") by this Identity. Useful for a unified spend/income view without two separate calls.
For seller-only history, use GET /v0/payments — same data filtered to inbound and shaped as PaymentSummary.
Request
import { Loomal } from "@loomal/sdk";
const loomal = new Loomal({ apiKey: process.env.LOOMAL_API_KEY! });
const { activity, count } = await loomal.payments.activity({ limit: 50 });
for (const row of activity) {
if (row.direction === "out") {
console.log(`paid ${row.amountUsdcRaw} to ${row.counterparty}`);
} else {
console.log(`received ${row.amountUsdcRaw} from ${row.counterparty}`);
}
}import os
from loomal import Loomal
loomal = Loomal(api_key=os.environ["LOOMAL_API_KEY"])
result = loomal.payments.activity(limit=50)
for row in result["activity"]:
if row["direction"] == "out":
print(f"paid {row['amountUsdcRaw']} to {row['counterparty']}")
else:
print(f"received {row['amountUsdcRaw']} from {row['counterparty']}")curl https://api.loomal.ai/v0/payments/activity?limit=50 \
-H "Authorization: Bearer loid-your-api-key"Query Parameters
| Param | Type | Default | Description |
|---|---|---|---|
limit | number | 50 | Max rows to return, capped at 200. Applied after the in + out merge, so you always get the latest limit events overall. |
Response — 200 OK
{
"activity": [
{
"id": "po_abc123",
"direction": "out",
"network": "base",
"amountUsdcRaw": "50000",
"counterparty": "0x<seller-wallet>",
"resource": "https://seller.example.com/search",
"txHash": "0x<onchain-settle-tx-hash>",
"status": "settled",
"failureReason": null,
"createdAt": "2026-05-12T10:00:00.000Z",
"mandateId": "m_abc123"
},
{
"id": "pi_def456",
"direction": "in",
"network": "base",
"amountUsdcRaw": "25000",
"counterparty": "0x<buyer-wallet>",
"resource": "https://your-api.com/search",
"txHash": "0x<onchain-settle-tx-hash>",
"status": "settled",
"failureReason": null,
"createdAt": "2026-05-11T09:00:00.000Z",
"endpointId": "se_abc",
"endpoint": { "id": "se_abc", "urlPattern": "https://your-api.com/search" }
}
],
"count": 2
}Row fields
Every row shares a common shape; direction discriminates the two variants.
| Field | Description |
|---|---|
id | Unique payment id. Prefixed po_ for outbound, pi_ for inbound. |
direction | "out" (you paid) or "in" (you received). |
amountUsdcRaw | Amount in raw USDC units (6 decimals). Divide by 1,000,000 for the decimal value. |
counterparty | Seller wallet on out rows; payer wallet on in rows. |
resource | URL the payment was for. null only for orphaned inbound rows. |
txHash | On-chain settle hash on Base. null for failed or unsettled rows. |
status | "settled", "verified", "failed", or "unpaid_delivered". |
failureReason | Human-readable cause when status === "failed". |
endpointId / endpoint | (Inbound only) The seller endpoint that received the payment, when registered. |
mandateId | (Outbound only) The mandate that authorized this spend. |
Errors
| Status | error | Cause |
|---|---|---|
| 401 | unauthorized | Missing or invalid Authorization header |
Next
POST /v0/payments/pay— pay a new x402 URL.GET /v0/payments/:id— fetch a single payment with its full Ed25519 receipt (seller side).