from metrifox_sdk import MetrifoxClient
client = MetrifoxClient(api_key="your_api_key")
# Get customer details
customer_key = "ac85f76a-9c20-4509-9453-daa9480a1ac6"
response = client.customers.get_details(customer_key)
print(f"Customer info: {response['data']['customer_key']}, {response['data']['primary_email']}")
print(f"Product subscriptions: {response['data']['subscriptions']}")
# Access details for each product
for product_sub in response['data']['subscriptions']:
print(f"Product: {product_sub['product_name']}")
print(f"Subscription: {product_sub['subscription']}")
print(f"Entitlements: {product_sub['entitlements']}")
print(f"Wallets: {product_sub['wallets']}"){
"statusCode": 200,
"message": "Customer Details Fetched Successfully",
"meta": {},
"data": {
"metrifox_id": "fa545755-be20-4d1b-85d0-a2265dd52c56",
"customer_key": "cust-mljp3ra6ffjm",
"customer_type": "INDIVIDUAL",
"primary_email": "uppender@yopmail.com",
"display_name": "Uppender Lala",
"full_name": "Uppender Lala",
"billing_email": "uppender@yopmail.com",
"billing_address": null,
"currency": "USD",
"timezone": null,
"language": null,
"tenant_checkout_username": "sandbox-notch-hr",
"subscriptions": [
{
"product_key": "product_deliveroo_df37",
"product_name": "Deliveroo",
"status": "active",
"subscription": {
"can_update_quantities": true,
"update_quantity_link": "https://checkout.metrifox.com/update-quantity/625f5cee-259b-4994-b7eb-416b9e551f2c",
"id": "625f5cee-259b-4994-b7eb-416b9e551f2c",
"status": "active",
"starts_at": "2026-02-13T13:01:17.828Z",
"ends_at": null,
"cancelled_at": null,
"renews_at": "2026-03-12T16:55:21.847Z",
"trial_end_date": null,
"post_trial_action": null,
"plan_name": "Basic-less Plan",
"plan_version": 2,
"default_plan_id": null,
"default_plan_name": null,
"product_name": "Deliveroo",
"product_key": "product_deliveroo_df37",
"offering_key": "plan_basic-less_plan_timf",
"currency_code": "USD",
"created_at": "2026-02-13T13:01:18.434Z",
"next_billing_date": "Mar 12, 2026",
"next_billing_amount": 21,
"current_billing_period_start": "2026-02-13T13:01:17.828Z",
"current_billing_period_end": "2026-03-12T16:55:21.847Z",
"subscription_items": [
{
"price_option_id": "a746f6e4-a2a0-4d72-9012-cb1815478331",
"name": "Basic-less Plan",
"quantity": 1,
"unit_price": 15,
"total_amount": 15,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Offerings::Plan",
"source_id": "9ecf5f02-445b-43de-a12f-168aa4a4a1fa"
},
{
"price_option_id": "862048ae-6d2c-41ad-9fa9-924d45eed9aa",
"name": "Seats",
"quantity": 3,
"unit_price": null,
"total_amount": 3,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "262bd36c-eef8-4981-8c58-52c952d3f42e"
},
{
"price_option_id": "4ff36eea-ca4f-4fa7-9294-e744d9ba056d",
"name": "Skills Audit",
"quantity": 2,
"unit_price": null,
"total_amount": 3,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "20910dfa-4a88-451c-9b85-2ed8ba937e97"
}
],
"upcoming_invoice": {
"invoice_id": "0d9e5a0e-7de4-48c6-b01a-b1759394578b",
"invoice_number": null,
"amount": "21.0",
"currency": {
"id": "4c1a44b7-7369-4415-84f7-2a5bab99932b",
"code": "USD",
"name": "US Dollar",
"country": "United States of America",
"decimal_places": 2,
"symbol": "$",
"is_active": true,
"base_unit_name": "cents",
"base_unit_per_standard": 100,
"created_at": "2025-11-17T00:33:16.053Z",
"updated_at": "2025-11-17T00:33:16.053Z",
"country_code": "US"
},
"due_date": "2026-04-01T23:59:59.999Z",
"status": "draft"
}
},
"entitlements": [],
"wallets": [],
"subscriptions_history": [
{
"can_update_quantities": true,
"update_quantity_link": "https://checkout.metrifox.com/update-quantity/625f5cee-259b-4994-b7eb-416b9e551f2c",
"id": "625f5cee-259b-4994-b7eb-416b9e551f2c",
"status": "active",
"starts_at": "2026-02-13T13:01:17.828Z",
"ends_at": null,
"cancelled_at": null,
"renews_at": "2026-03-12T16:55:21.847Z",
"trial_end_date": null,
"post_trial_action": null,
"plan_name": "Basic-less Plan",
"plan_version": 2,
"default_plan_id": null,
"default_plan_name": null,
"product_name": "Deliveroo",
"product_key": "product_deliveroo_df37",
"offering_key": "plan_basic-less_plan_timf",
"currency_code": "USD",
"created_at": "2026-02-13T13:01:18.434Z",
"next_billing_date": "Mar 12, 2026",
"next_billing_amount": 21,
"current_billing_period_start": "2026-02-13T13:01:17.828Z",
"current_billing_period_end": "2026-03-12T16:55:21.847Z",
"subscription_items": [
{
"price_option_id": "a746f6e4-a2a0-4d72-9012-cb1815478331",
"name": "Basic-less Plan",
"quantity": 1,
"unit_price": 15,
"total_amount": 15,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Offerings::Plan",
"source_id": "9ecf5f02-445b-43de-a12f-168aa4a4a1fa"
},
{
"price_option_id": "862048ae-6d2c-41ad-9fa9-924d45eed9aa",
"name": "Seats",
"quantity": 3,
"unit_price": null,
"total_amount": 3,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "262bd36c-eef8-4981-8c58-52c952d3f42e"
},
{
"price_option_id": "4ff36eea-ca4f-4fa7-9294-e744d9ba056d",
"name": "Skills Audit",
"quantity": 2,
"unit_price": null,
"total_amount": 3,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "20910dfa-4a88-451c-9b85-2ed8ba937e97"
}
],
"upcoming_invoice": {
"invoice_id": "0d9e5a0e-7de4-48c6-b01a-b1759394578b",
"invoice_number": null,
"amount": "21.0",
"currency": {
"id": "4c1a44b7-7369-4415-84f7-2a5bab99932b",
"code": "USD",
"name": "US Dollar",
"country": "United States of America",
"decimal_places": 2,
"symbol": "$",
"is_active": true,
"base_unit_name": "cents",
"base_unit_per_standard": 100,
"created_at": "2025-11-17T00:33:16.053Z",
"updated_at": "2025-11-17T00:33:16.053Z",
"country_code": "US"
},
"due_date": "2026-04-01T23:59:59.999Z",
"status": "draft"
}
},
{
"can_update_quantities": true,
"update_quantity_link": "https://checkout.metrifox.com/update-quantity/c541c94a-6a02-4bc0-bf8b-1a5a4245e1d8",
"id": "c541c94a-6a02-4bc0-bf8b-1a5a4245e1d8",
"status": "deactivated",
"starts_at": "2026-02-12T16:55:21.847Z",
"ends_at": "2026-02-13T13:01:13.118Z",
"cancelled_at": "2026-02-13T13:01:13.116Z",
"renews_at": "2026-03-12T16:55:25.679Z",
"trial_end_date": null,
"post_trial_action": null,
"plan_name": "Basic Plan",
"plan_version": 2,
"default_plan_id": null,
"default_plan_name": null,
"product_name": "Deliveroo",
"product_key": "product_deliveroo_df37",
"offering_key": "plan_basic_plan_fzx4",
"currency_code": "USD",
"created_at": "2026-02-12T16:55:22.468Z",
"next_billing_date": "Mar 12, 2026",
"next_billing_amount": 35,
"current_billing_period_start": "2026-02-12T16:55:21.847Z",
"current_billing_period_end": "2026-03-12T16:55:21.847Z",
"subscription_items": [
{
"price_option_id": "f97c478b-bea7-4ec1-b40a-186d9a61a8b7",
"name": "Basic Plan",
"quantity": 1,
"unit_price": 20,
"total_amount": 20,
"billing_period_start": "2026-02-12T16:55:21.847Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Offerings::Plan",
"source_id": "20da23ab-3262-456b-a577-d517918f8d3f"
},
{
"price_option_id": "6d4a043b-186d-4d20-98c2-c5226c5a27c3",
"name": "Seats",
"quantity": 5,
"unit_price": null,
"total_amount": 25,
"billing_period_start": "2026-02-12T16:55:21.847Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "ce08372d-dc3e-4f6d-99d1-9b481ee77348"
},
{
"price_option_id": "dc0f2ae9-b362-49d2-b2a6-bf78ae0a756f",
"name": "Skills Audit",
"quantity": 4,
"unit_price": null,
"total_amount": 12,
"billing_period_start": "2026-02-12T16:55:21.847Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "1336591e-cf5d-49f7-8ca1-696cbd0f2a82"
}
],
"upcoming_invoice": {
"invoice_id": "01052f5e-a018-4aad-a73e-1140f3da060c",
"invoice_number": null,
"amount": "35.0",
"currency": {
"id": "4c1a44b7-7369-4415-84f7-2a5bab99932b",
"code": "USD",
"name": "US Dollar",
"country": "United States of America",
"decimal_places": 2,
"symbol": "$",
"is_active": true,
"base_unit_name": "cents",
"base_unit_per_standard": 100,
"created_at": "2025-11-17T00:33:16.053Z",
"updated_at": "2025-11-17T00:33:16.053Z",
"country_code": "US"
},
"due_date": "2026-04-01T23:59:59.999Z",
"status": "draft"
}
}
],
"payment_method": null
}
]
},
"errors": {}
}Retrieves comprehensive details for a customer including all product subscriptions, entitlements, wallets, and payment methods.
Returns:
from metrifox_sdk import MetrifoxClient
client = MetrifoxClient(api_key="your_api_key")
# Get customer details
customer_key = "ac85f76a-9c20-4509-9453-daa9480a1ac6"
response = client.customers.get_details(customer_key)
print(f"Customer info: {response['data']['customer_key']}, {response['data']['primary_email']}")
print(f"Product subscriptions: {response['data']['subscriptions']}")
# Access details for each product
for product_sub in response['data']['subscriptions']:
print(f"Product: {product_sub['product_name']}")
print(f"Subscription: {product_sub['subscription']}")
print(f"Entitlements: {product_sub['entitlements']}")
print(f"Wallets: {product_sub['wallets']}"){
"statusCode": 200,
"message": "Customer Details Fetched Successfully",
"meta": {},
"data": {
"metrifox_id": "fa545755-be20-4d1b-85d0-a2265dd52c56",
"customer_key": "cust-mljp3ra6ffjm",
"customer_type": "INDIVIDUAL",
"primary_email": "uppender@yopmail.com",
"display_name": "Uppender Lala",
"full_name": "Uppender Lala",
"billing_email": "uppender@yopmail.com",
"billing_address": null,
"currency": "USD",
"timezone": null,
"language": null,
"tenant_checkout_username": "sandbox-notch-hr",
"subscriptions": [
{
"product_key": "product_deliveroo_df37",
"product_name": "Deliveroo",
"status": "active",
"subscription": {
"can_update_quantities": true,
"update_quantity_link": "https://checkout.metrifox.com/update-quantity/625f5cee-259b-4994-b7eb-416b9e551f2c",
"id": "625f5cee-259b-4994-b7eb-416b9e551f2c",
"status": "active",
"starts_at": "2026-02-13T13:01:17.828Z",
"ends_at": null,
"cancelled_at": null,
"renews_at": "2026-03-12T16:55:21.847Z",
"trial_end_date": null,
"post_trial_action": null,
"plan_name": "Basic-less Plan",
"plan_version": 2,
"default_plan_id": null,
"default_plan_name": null,
"product_name": "Deliveroo",
"product_key": "product_deliveroo_df37",
"offering_key": "plan_basic-less_plan_timf",
"currency_code": "USD",
"created_at": "2026-02-13T13:01:18.434Z",
"next_billing_date": "Mar 12, 2026",
"next_billing_amount": 21,
"current_billing_period_start": "2026-02-13T13:01:17.828Z",
"current_billing_period_end": "2026-03-12T16:55:21.847Z",
"subscription_items": [
{
"price_option_id": "a746f6e4-a2a0-4d72-9012-cb1815478331",
"name": "Basic-less Plan",
"quantity": 1,
"unit_price": 15,
"total_amount": 15,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Offerings::Plan",
"source_id": "9ecf5f02-445b-43de-a12f-168aa4a4a1fa"
},
{
"price_option_id": "862048ae-6d2c-41ad-9fa9-924d45eed9aa",
"name": "Seats",
"quantity": 3,
"unit_price": null,
"total_amount": 3,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "262bd36c-eef8-4981-8c58-52c952d3f42e"
},
{
"price_option_id": "4ff36eea-ca4f-4fa7-9294-e744d9ba056d",
"name": "Skills Audit",
"quantity": 2,
"unit_price": null,
"total_amount": 3,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "20910dfa-4a88-451c-9b85-2ed8ba937e97"
}
],
"upcoming_invoice": {
"invoice_id": "0d9e5a0e-7de4-48c6-b01a-b1759394578b",
"invoice_number": null,
"amount": "21.0",
"currency": {
"id": "4c1a44b7-7369-4415-84f7-2a5bab99932b",
"code": "USD",
"name": "US Dollar",
"country": "United States of America",
"decimal_places": 2,
"symbol": "$",
"is_active": true,
"base_unit_name": "cents",
"base_unit_per_standard": 100,
"created_at": "2025-11-17T00:33:16.053Z",
"updated_at": "2025-11-17T00:33:16.053Z",
"country_code": "US"
},
"due_date": "2026-04-01T23:59:59.999Z",
"status": "draft"
}
},
"entitlements": [],
"wallets": [],
"subscriptions_history": [
{
"can_update_quantities": true,
"update_quantity_link": "https://checkout.metrifox.com/update-quantity/625f5cee-259b-4994-b7eb-416b9e551f2c",
"id": "625f5cee-259b-4994-b7eb-416b9e551f2c",
"status": "active",
"starts_at": "2026-02-13T13:01:17.828Z",
"ends_at": null,
"cancelled_at": null,
"renews_at": "2026-03-12T16:55:21.847Z",
"trial_end_date": null,
"post_trial_action": null,
"plan_name": "Basic-less Plan",
"plan_version": 2,
"default_plan_id": null,
"default_plan_name": null,
"product_name": "Deliveroo",
"product_key": "product_deliveroo_df37",
"offering_key": "plan_basic-less_plan_timf",
"currency_code": "USD",
"created_at": "2026-02-13T13:01:18.434Z",
"next_billing_date": "Mar 12, 2026",
"next_billing_amount": 21,
"current_billing_period_start": "2026-02-13T13:01:17.828Z",
"current_billing_period_end": "2026-03-12T16:55:21.847Z",
"subscription_items": [
{
"price_option_id": "a746f6e4-a2a0-4d72-9012-cb1815478331",
"name": "Basic-less Plan",
"quantity": 1,
"unit_price": 15,
"total_amount": 15,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Offerings::Plan",
"source_id": "9ecf5f02-445b-43de-a12f-168aa4a4a1fa"
},
{
"price_option_id": "862048ae-6d2c-41ad-9fa9-924d45eed9aa",
"name": "Seats",
"quantity": 3,
"unit_price": null,
"total_amount": 3,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "262bd36c-eef8-4981-8c58-52c952d3f42e"
},
{
"price_option_id": "4ff36eea-ca4f-4fa7-9294-e744d9ba056d",
"name": "Skills Audit",
"quantity": 2,
"unit_price": null,
"total_amount": 3,
"billing_period_start": "2026-02-13T13:01:17.828Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "20910dfa-4a88-451c-9b85-2ed8ba937e97"
}
],
"upcoming_invoice": {
"invoice_id": "0d9e5a0e-7de4-48c6-b01a-b1759394578b",
"invoice_number": null,
"amount": "21.0",
"currency": {
"id": "4c1a44b7-7369-4415-84f7-2a5bab99932b",
"code": "USD",
"name": "US Dollar",
"country": "United States of America",
"decimal_places": 2,
"symbol": "$",
"is_active": true,
"base_unit_name": "cents",
"base_unit_per_standard": 100,
"created_at": "2025-11-17T00:33:16.053Z",
"updated_at": "2025-11-17T00:33:16.053Z",
"country_code": "US"
},
"due_date": "2026-04-01T23:59:59.999Z",
"status": "draft"
}
},
{
"can_update_quantities": true,
"update_quantity_link": "https://checkout.metrifox.com/update-quantity/c541c94a-6a02-4bc0-bf8b-1a5a4245e1d8",
"id": "c541c94a-6a02-4bc0-bf8b-1a5a4245e1d8",
"status": "deactivated",
"starts_at": "2026-02-12T16:55:21.847Z",
"ends_at": "2026-02-13T13:01:13.118Z",
"cancelled_at": "2026-02-13T13:01:13.116Z",
"renews_at": "2026-03-12T16:55:25.679Z",
"trial_end_date": null,
"post_trial_action": null,
"plan_name": "Basic Plan",
"plan_version": 2,
"default_plan_id": null,
"default_plan_name": null,
"product_name": "Deliveroo",
"product_key": "product_deliveroo_df37",
"offering_key": "plan_basic_plan_fzx4",
"currency_code": "USD",
"created_at": "2026-02-12T16:55:22.468Z",
"next_billing_date": "Mar 12, 2026",
"next_billing_amount": 35,
"current_billing_period_start": "2026-02-12T16:55:21.847Z",
"current_billing_period_end": "2026-03-12T16:55:21.847Z",
"subscription_items": [
{
"price_option_id": "f97c478b-bea7-4ec1-b40a-186d9a61a8b7",
"name": "Basic Plan",
"quantity": 1,
"unit_price": 20,
"total_amount": 20,
"billing_period_start": "2026-02-12T16:55:21.847Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Offerings::Plan",
"source_id": "20da23ab-3262-456b-a577-d517918f8d3f"
},
{
"price_option_id": "6d4a043b-186d-4d20-98c2-c5226c5a27c3",
"name": "Seats",
"quantity": 5,
"unit_price": null,
"total_amount": 25,
"billing_period_start": "2026-02-12T16:55:21.847Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "ce08372d-dc3e-4f6d-99d1-9b481ee77348"
},
{
"price_option_id": "dc0f2ae9-b362-49d2-b2a6-bf78ae0a756f",
"name": "Skills Audit",
"quantity": 4,
"unit_price": null,
"total_amount": 12,
"billing_period_start": "2026-02-12T16:55:21.847Z",
"billing_period_end": "2026-03-12T16:55:21.847Z",
"line_source_type": "SubscriptionItem",
"is_addon": false,
"pricing": null,
"currency_code": "USD",
"source_type": "ProductCatalogues::Entitlements::PaidEntitlement",
"source_id": "1336591e-cf5d-49f7-8ca1-696cbd0f2a82"
}
],
"upcoming_invoice": {
"invoice_id": "01052f5e-a018-4aad-a73e-1140f3da060c",
"invoice_number": null,
"amount": "35.0",
"currency": {
"id": "4c1a44b7-7369-4415-84f7-2a5bab99932b",
"code": "USD",
"name": "US Dollar",
"country": "United States of America",
"decimal_places": 2,
"symbol": "$",
"is_active": true,
"base_unit_name": "cents",
"base_unit_per_standard": 100,
"created_at": "2025-11-17T00:33:16.053Z",
"updated_at": "2025-11-17T00:33:16.053Z",
"country_code": "US"
},
"due_date": "2026-04-01T23:59:59.999Z",
"status": "draft"
}
}
],
"payment_method": null
}
]
},
"errors": {}
}Metrifox customer ID (UUID)