Skip to main content

Overview

When you create an offering in Metrifox, you define which features customers can access based on their plan or add-ons. Use the CheckAccess method to verify whether a customer is entitled to a specific feature. This lets you:
  • Grant access
  • Block usage
  • Prompt for upgrade
  • Bill for overage

Checking Metered Features

Before a customer uses a metered feature, you can check:
  • Whether they’re allowed to use it
  • How much usage they’ve already consumed
Example: AI Image Generation Let’s say your free plan includes 50 AI image generations per month. Before generating an image, use the CheckAccess method to see if the customer has any remaining quota. If they do:
  1. Allow the image generation
  2. Record the usage event so Metrifox can update their balance.

    SDK available in

    Javascript | Ruby | cURL | Python | PHP | Go | Java
    {
      "message": "Access checked",
      "can_access": true,
      "customer_key": "cust-6d11ca90",
      "feature_key": "feature_interview_booking",
      "required_quantity": 1,
      "used_quantity": 6,
      "included_usage": 1,
      "next_reset_at": 1758412800000,
      "quota": 10,
      "unlimited": false,
      "carryover_quantity": 0,
      "balance": 4,
      "entitlement_active": true
    }
    
If a customer’s payment fails, by default, Metrifox will block access to the feature.

Checking Boolean Feature Access

Use the CheckAccess method to verify if a customer should have access to a feature.