Skip to main content
GET
/
api
/
v1
/
customers
/
{customer_key}
/
details
Javascript SDK
import { init } from "metrifox-js";

const metrifoxClient = init({
  apiKey: process.env.METRIFOX_API_KEY
});

// Get customer details
const customerId = "ac85f76a-9c20-4509-9453-daa9480a1ac6";
const response = await metrifoxClient.customers.getDetails(customerId);

console.log("Customer info:", response.data.customer_key, response.data.primary_email);
console.log("Product subscriptions:", response.data.subscriptions);

// Access details for each product
response.data.subscriptions.forEach(productSub => {
  console.log(`Product: ${productSub.product_name}`);
  console.log(`Subscription:`, productSub.subscription);
  console.log(`Entitlements:`, productSub.entitlements);
  console.log(`Wallets:`, productSub.wallets);
});
{
  "statusCode": 200,
  "message": "Customer Details Fetched Successfully",
  "meta": {},
  "data": {
    "metrifox_id": "ac85f76a-9c20-4509-9453-daa9480a1ac6",
    "customer_key": "DEV-TJH3UUAHA",
    "customer_type": "BUSINESS",
    "primary_email": "[email protected]",
    "display_name": "Example Company",
    "full_name": "Example Company Inc",
    "billing_email": "[email protected]",
    "billing_address": {
      "line1": "123 Main St",
      "line2": "Suite 100",
      "city": "San Francisco",
      "state": "CA",
      "postal_code": "94105",
      "country": "US"
    },
    "currency": "USD",
    "timezone": "America/Los_Angeles",
    "language": "en",
    "tenant_checkout_username": "example-company",
    "subscriptions": [
      {
        "product_key": "ai-recruitment-agent",
        "product_name": "AI Recruitment Agent",
        "status": "active",
        "subscription": {
          "id": "6ba0132d-a886-4ccc-85fa-385f6d515d91",
          "status": "active",
          "starts_at": "2025-08-27T11:56:54.820Z",
          "ends_at": null,
          "renews_at": "2025-09-27T11:56:54.819Z",
          "trial_end_date": null,
          "post_trial_action": null,
          "plan_name": "Basic Plan",
          "plan_version": 1,
          "default_plan_id": null,
          "default_plan_name": null,
          "product_name": "AI Recruitment Agent",
          "product_key": "ai-recruitment-agent",
          "offering_key": "standard-offering",
          "currency_code": "USD",
          "created_at": "2025-08-27T11:56:54.824Z",
          "next_billing_date": "Sep 27, 2025",
          "next_billing_amount": 1440.0208,
          "current_billing_period_start": "2025-08-27T11:56:54.820Z",
          "current_billing_period_end": "2025-09-27T11:56:54.820Z",
          "subscription_items": [],
          "upcoming_invoice": null,
          "can_update_quantities": false
        },
        "entitlements": [
          {
            "id": "db10505c-55ac-4780-a59f-ddd2aee11bdb",
            "name": "Candidate Sourcing",
            "used_quantity": 710,
            "carryover_quantity": 0,
            "quota": "unlimited",
            "included_usage": 10,
            "reset_interval": "monthly",
            "next_reset_at": "2025-09-27T00:00:00.000Z",
            "feature_type": "metered"
          }
        ],
        "wallets": [
          {
            "id": "c6bbd894-f6fa-4614-9795-b7f24a0932c9",
            "name": "Tokens",
            "credit_unit_singular": "Token",
            "credit_unit_plural": "Tokens",
            "balance": 36,
            "allocations": [],
            "credit_key": "tokens"
          },
          {
            "id": "92f6d7fc-ad24-4adb-b614-bd6d1350e02c",
            "name": "Cowries",
            "credit_unit_singular": "Cowrie",
            "credit_unit_plural": "Cowries",
            "balance": 0,
            "allocations": [],
            "credit_key": "cowries"
          }
        ],
        "subscriptions_history": [
          {
            "id": "5ba0132d-a886-4ccc-85fa-385f6d515d91",
            "status": "cancelled",
            "starts_at": "2025-07-01T00:00:00.000Z",
            "ends_at": "2025-08-27T11:56:54.820Z",
            "renews_at": null,
            "trial_end_date": null,
            "post_trial_action": null,
            "plan_name": "Starter Plan",
            "plan_version": 1,
            "default_plan_id": null,
            "default_plan_name": null,
            "product_name": "AI Recruitment Agent",
            "product_key": "ai-recruitment-agent",
            "offering_key": "standard-offering",
            "currency_code": "USD",
            "created_at": "2025-07-01T00:00:00.000Z",
            "next_billing_date": null,
            "next_billing_amount": null,
            "current_billing_period_start": "2025-07-27T00:00:00.000Z",
            "current_billing_period_end": "2025-08-27T00:00:00.000Z",
            "subscription_items": [],
            "upcoming_invoice": null,
            "can_update_quantities": false
          }
        ],
        "payment_method": {
          "type": "card",
          "brand": "visa",
          "last4": "4242",
          "exp_month": "12",
          "exp_year": "2026",
          "display_name": "Visa ending in 4242",
          "bank_name": null
        }
      }
    ]
  },
  "errors": {}
}

Authorizations

x-api-key
string
header
required

Path Parameters

id
string<uuid>
required

Metrifox customer ID (UUID)

Response

Customer details fetched successfully

statusCode
integer
Example:

200

message
string
Example:

"Customer Details Fetched Successfully"

meta
object

Additional metadata

data
object
errors
object

Any errors that occurred