Subscriptions
Query and manage subscriptions via the SDK.
Subscriptions
Query subscription data for your app — active subscribers, payment history, and
on-chain state. Methods that hit the merchant API use the apiKey you passed to
new RecurClient(...). Subscriber methods take a JWT per call.
All API methods return an ApiResponse<T>:
Always check res.success before reading res.data.
Merchant: list subscriptions
listSubscriptions(appId, options?) only paginates — filter client-side on
status if needed.
Merchant: get payment history
Subscriber: my subscriptions
Authenticated as a subscriber, list all subscriptions for the wallet that owns the JWT.
Subscriber: a single subscription by PDA
Looks up a subscription by its on-chain PDA across the subscriber's records.
Register an on-chain subscription
After buildSubscribeTransaction confirms on-chain, register it with the Recur
API using the subscriber JWT. The Keeper's chain scanner is a fallback if this
call is missed.
Read on-chain state
Fetch the raw on-chain Subscription account directly from Solana — no API call:
On-chain fields
| Field | Type | Description |
|---|---|---|
subscriber | PublicKey | Subscriber wallet |
merchant | PublicKey | Merchant wallet |
planSeed | number[] | 8-byte plan seed |
amount | bigint | USDC base units per interval |
interval | bigint | Seconds between payments |
lastPaymentTimestamp | bigint | Unix timestamp of last successful pull |
createdAt | bigint | Unix timestamp of PDA creation |
cancelRequestedAt | bigint | 0 = active, non-zero = cancel timestamp |
bump | number | PDA bump seed |
Derive a PDA
If you know the subscriber, merchant, and plan seed, derive the PDA without an RPC or API call:
This is equivalent to using the lower-level helper: