Skip to main content
GET
/
api
/
v1
/
customers
/
{customer_key}
/
check-active-subscription
Python SDK
from metrifox_sdk import MetrifoxClient

client = MetrifoxClient(api_key="your_api_key")

# Check if customer has an active subscription
has_active_subscription = client.customers.has_active_subscription("test-customer-key")

print(has_active_subscription)  # True or False

if has_active_subscription:
    print("Customer has an active subscription")
else:
    print("Customer does not have an active subscription")
{
"statusCode": 200,
"message": "",
"data": {
"has_active_subscription": true
}
}

Authorizations

x-api-key
string
header
required

Path Parameters

customer_key
string
required

The unique identifier for the customer

Response

Active subscription status checked successfully

statusCode
integer
Example:

200

message
string
Example:

""

data
object