Skip to main content
Defined in the Base Account SDK
The subscription.getStatus function retrieves the current status and details of a subscription created with spend permissions. Use this to check if a subscription is active, view remaining charges, and determine the next payment period.

Parameters

id
string
required
The subscription ID (permission hash) returned from subscribe().Pattern: ^0x[0-9a-fA-F]{64}$
testnet
boolean
Must match the testnet setting used in the original subscribe call. Default: false

Returns

result
SubscriptionStatus
Subscription status information including current state and payment details.

Usage Patterns

Always check subscription status before attempting to charge:

Error Handling

The function may throw errors for invalid subscription IDs or network issues: