Skip to main content

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:

ParameterTypeDescription
merchantstringMerchant wallet address (0x…)

Query parameters:

ParameterTypeRequiredDescription
chain_idnumberNoChain ID to filter. Defaults to the indexer's configured chain.
typestringNoFilter by activity type: CHARGE, FAIL, or REFILL
limitnumberNoMaximum results to return (1–1000). If omitted, all matching rows are returned.
sincestringNoISO 8601 timestamp — only return activity on or after this time
tokenstringNoFilter by token symbol (case-insensitive, e.g. usdc)

Response fields:

FieldTypeDescription
event_idstringUnique event identifier
allocation_idstringSubscription allocation ID
module_addressstringSubscriptionModule contract address
tx_hashstringTransaction hash
block_numberstringBlock number
typestring"CHARGE", "FAIL", or "REFILL"
amount_chargedstringAmount in token base units. "0" for failures.
token_decimalsnumber | nullToken decimal places
currencystring | nullToken symbol (e.g. "USDC")
reasonstring | nullFailure reason if type is "FAIL" (e.g. "InsufficientAllowance"). null for charges.
keeper_addressstring | nullAddress of the keeper that executed the transaction
fee_paidstring | nullProtocol fee paid, in token base units
timestampstringISO 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:

ParameterTypeDescription
merchantstringMerchant wallet address (0x…)

Query parameters:

ParameterTypeRequiredDescription
chain_idnumberNoChain 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:

ParameterTypeDescription
merchantstringMerchant wallet address (0x…)

Query parameters:

ParameterTypeRequiredDescription
chain_idnumberNoChain 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.

  • Subscriptions — Subscription state and authorization checks
  • Troubleshooting — Failure code reference with remediation steps
  • Webhooks — Receive real-time notifications instead of polling