Appearance
Payments API
Manage transactions, payment methods, notifications, x402 resources, and Stripe integrations.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/agents/{id}/transactions | List transactions |
| GET | /api/agents/{id}/payment-methods | List payment methods |
| POST | /api/agents/{id}/payment-methods | Create payment method |
| GET | /api/agents/{id}/payment-notifications | List payment notifications |
| POST | /api/agents/{id}/x402-resources | Create x402 resource |
| GET | /api/agents/{id}/x402-resources | List x402 resources |
| DELETE | /api/agents/{id}/x402-resources/{resourceId} | Delete x402 resource |
| POST | /api/agents/{id}/stripe/checkout | Create checkout session |
| POST | /api/agents/{id}/stripe/charge | Charge an issuing card |
| GET | /api/agents/{id}/stripe/cards | List issuing cards |
| POST | /api/agents/{id}/stripe/webhook | Stripe webhook endpoint |
Transactions
List Transactions
bash
GET /api/agents/{id}/transactionsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
type | string | Filter by type: inbound, outbound, x402 |
currency | string | Filter by currency |
limit | number | Max results (default: 50) |
offset | number | Pagination offset |
Response
json
{
"transactions": [
{
"id": "txn_abc123",
"type": "inbound",
"amount": "25.00",
"currency": "USD",
"from": "John Doe",
"to": "Agent Wallet",
"reference": "REF123456",
"source": "bank_notification",
"created_at": "2026-03-11T10:00:00Z"
}
],
"total": 142
}Payment Methods
List Payment Methods
bash
GET /api/agents/{id}/payment-methodsResponse
json
{
"methods": [
{
"id": "pm_123",
"type": "wallet",
"label": "USDC Wallet",
"details": {
"address": "0x1234...abcd",
"network": "base"
},
"created_at": "2026-03-01T00:00:00Z"
}
]
}Create Payment Method
bash
POST /api/agents/{id}/payment-methods
Content-Type: application/jsonRequest Body
json
{
"type": "wallet",
"label": "USDC Wallet",
"details": {
"address": "0x1234...abcd",
"network": "base"
}
}Response
json
{
"id": "pm_456",
"type": "wallet",
"label": "USDC Wallet",
"details": {
"address": "0x1234...abcd",
"network": "base"
},
"created_at": "2026-03-11T12:00:00Z"
}Payment Notifications
List Payment Notifications
bash
GET /api/agents/{id}/payment-notificationsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter: matched, unmatched |
limit | number | Max results (default: 50) |
Response
json
{
"notifications": [
{
"id": "pn_789",
"gateway": "telegram",
"message": "You received $25.00 from John Doe. Ref: REF123456",
"status": "matched",
"transaction_id": "txn_abc123",
"parsed": {
"amount": "25.00",
"currency": "USD",
"from": "John Doe",
"reference": "REF123456"
},
"created_at": "2026-03-11T10:00:00Z"
}
]
}x402 Resources
Create x402 Resource
bash
POST /api/agents/{id}/x402-resources
Content-Type: application/jsonRequest Body
json
{
"path": "/rpc/premium-analysis",
"price": "0.01",
"currency": "USDC",
"network": "base",
"description": "Premium market analysis"
}Response
json
{
"id": "x402_123",
"path": "/rpc/premium-analysis",
"price": "0.01",
"currency": "USDC",
"network": "base",
"description": "Premium market analysis",
"created_at": "2026-03-11T12:00:00Z"
}List x402 Resources
bash
GET /api/agents/{id}/x402-resourcesResponse
json
{
"resources": [
{
"id": "x402_123",
"path": "/rpc/premium-analysis",
"price": "0.01",
"currency": "USDC",
"network": "base",
"description": "Premium market analysis",
"created_at": "2026-03-11T12:00:00Z"
}
]
}Delete x402 Resource
bash
DELETE /api/agents/{id}/x402-resources/{resourceId}Response
json
{
"success": true
}Stripe
Create Checkout Session
bash
POST /api/agents/{id}/stripe/checkout
Content-Type: application/jsonRequest Body
json
{
"amount": 2000,
"currency": "usd",
"description": "Pro Plan",
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel"
}Response
json
{
"session_id": "cs_abc123",
"url": "https://checkout.stripe.com/pay/cs_abc123",
"status": "open"
}Charge Issuing Card
bash
POST /api/agents/{id}/stripe/charge
Content-Type: application/jsonRequest Body
json
{
"card_id": "ic_abc123",
"amount": 500,
"currency": "usd",
"description": "API subscription"
}Response
json
{
"charge_id": "ch_abc123",
"amount": 500,
"currency": "usd",
"status": "succeeded"
}List Issuing Cards
bash
GET /api/agents/{id}/stripe/cardsResponse
json
{
"cards": [
{
"id": "ic_abc123",
"last4": "4242",
"brand": "Visa",
"status": "active",
"spending_limit": 10000,
"created_at": "2026-03-01T00:00:00Z"
}
]
}Stripe Webhook
bash
POST /api/agents/{id}/stripe/webhook
Stripe-Signature: t=...,v1=...This endpoint is called by Stripe. Configure it in the Stripe Dashboard.
Processed events:
| Event | Action |
|---|---|
checkout.session.completed | Logs transaction, marks session complete |
issuing_authorization.request | Approves or declines per agent settings |
charge.succeeded | Logs completed charge |
Signatures are verified using HMAC-SHA256 with the configured webhook secret.
Error Codes
| Code | Description |
|---|---|
400 | Invalid request body or missing required fields |
401 | Authentication required |
402 | Payment required (x402 gated endpoint) |
404 | Resource not found |
409 | Duplicate payment method or resource |
422 | Stripe API error (details in response body) |
500 | Internal server error |
Error response format:
json
{
"error": "Invalid amount",
"code": 400
}