Activity
Full activity log
GET /v0/activity/:merchant
Returns the full activity log for a merchant — payments, failures, and credit refills. Use the query parameters to filter by type, time range, or token.
Auth: API key or SIWE session
Path parameters:
| Parameter | Type | Description |
|---|---|---|
merchant | string | Merchant wallet address (0x…) |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
chain_id | number | No | Chain ID to filter. Defaults to the indexer's configured chain. |
type | string | No | Filter by activity type: CHARGE, FAIL, or REFILL |
limit | number | No | Maximum results to return (1–1000). If omitted, all matching rows are returned. |
since | string | No | ISO 8601 timestamp — only return activity on or after this time |
token | string | No | Filter by token symbol (case-insensitive, e.g. usdc) |
Response fields:
| Field | Type | Description |
|---|---|---|
event_id | string | Unique event identifier |
allocation_id | string | Subscription allocation ID |
module_address | string | SubscriptionModule contract address |
tx_hash | string | Transaction hash |
block_number | string | Block number |
type | string | "CHARGE", "FAIL", or "REFILL" |
amount_charged | string | Amount in token base units. "0" for failures. |
token_decimals | number | null | Token decimal places |
currency | string | null | Token symbol (e.g. "USDC") |
reason | string | null | Failure reason if type is "FAIL" (e.g. "InsufficientAllowance"). null for charges. |
keeper_address | string | null | Address of the keeper that executed the transaction |
fee_paid | string | null | Protocol fee paid, in token base units |
timestamp | string | ISO 8601 timestamp |
Example — filtering to failures in the last 24 hours:
const since = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
const res = await fetch(
`https://api.amser.io/v0/activity/0xMerchantAddress?type=FAIL&since=${since}`,
{
headers: {
'Authorization': `Bearer ${process.env.AMSER_API_KEY}`,
},
}
);
const failures = await res.json();
Example response:
[
{
"event_id": "evt_01j1234567890abcdef",
"allocation_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"module_address": "0xabcdef1234567890abcdef1234567890abcdef12",
"tx_hash": "0x9876543210fedcba9876543210fedcba9876543210fedcba9876543210fedcba",
"block_number": "12345678",
"type": "FAIL",
"amount_charged": "0",
"token_decimals": 6,
"currency": "USDC",
"reason": "InsufficientAllowance",
"keeper_address": "0x3333333333333333333333333333333333333333",
"fee_paid": null,
"timestamp": "2026-03-17T14:30:00.000Z"
}
]
Payments only
GET /v0/payments/:merchant
Returns only successful payment events (type: "CHARGE"). This is a convenience endpoint equivalent to GET /v0/activity/:merchant?type=CHARGE, intended for revenue reporting and billing dashboards.
Auth: API key or SIWE session
Path parameters:
| Parameter | Type | Description |
|---|---|---|
merchant | string | Merchant wallet address (0x…) |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
chain_id | number | No | Chain ID to filter |
The response shape is the same as the activity endpoint, with all entries having type: "CHARGE".
Example request:
const res = await fetch(
'https://api.amser.io/v0/payments/0xMerchantAddress',
{
headers: {
'Authorization': `Bearer ${process.env.AMSER_API_KEY}`,
},
}
);
const payments = await res.json();
Failures only
GET /v0/failures/:merchant
Returns only failed payment events (type: "FAIL"). Use this to build dunning dashboards or alerting systems that notify you when subscriber payments fail.
Auth: API key or SIWE session
Path parameters:
| Parameter | Type | Description |
|---|---|---|
merchant | string | Merchant wallet address (0x…) |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
chain_id | number | No | Chain ID to filter |
The response shape is the same as the activity endpoint, with all entries having type: "FAIL". The reason field contains the failure code from the PaymentProcessor contract (e.g. "InsufficientAllowance", "TransferFailed"). See the Troubleshooting page for a full reference of failure codes and remediation steps.
Related
- Subscriptions — Subscription state and authorization checks
- Troubleshooting — Failure code reference with remediation steps
- Webhooks — Receive real-time notifications instead of polling