import { init } from "metrifox-js";
const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});
// Get all customers with optional pagination
const response = await metrifoxClient.customers.list({
page: 1,
per_page: 25
});{
"statusCode": 200,
"message": "Customers fetched",
"meta": {
"current_page": 1,
"prev_page": null,
"next_page": null,
"per_page": 25,
"total_pages": 1,
"total_records": 2
},
"data": [
{
"id": "764c80e3-ed59-44a5-ba07-7ee5ba547774",
"primary_email": "[email protected]",
"primary_phone": "+1234567890",
"legal_name": "Acme Corporation",
"display_name": "Acme Corp",
"legal_number": null,
"tax_identification_number": null,
"logo_url": null,
"website_url": null,
"account_manager": null,
"first_name": null,
"middle_name": null,
"last_name": null,
"full_name": "Acme Corporation",
"billing_email": "[email protected]",
"timezone": "America/New_York",
"language": "en",
"currency": "USD",
"tax_status": "TAXABLE",
"address_line1": "123 Business Ave",
"address_line2": null,
"city": "New York",
"state": "NY",
"country": "United States",
"zip_code": "10001",
"shipping_address_line1": null,
"shipping_address_line2": null,
"shipping_city": null,
"shipping_state": null,
"shipping_country": null,
"shipping_zip_code": null,
"created_at": "2025-08-22T13:15:18.434Z",
"updated_at": "2025-08-22T13:15:18.434Z",
"customer_type": "BUSINESS",
"customer_key": "acme-corp-001",
"phone_numbers": [],
"email_addresses": [],
"billing_configuration": {},
"tax_identifications": [],
"contact_people": [],
"payment_terms": [],
"metadata": {},
"date_of_birth": null,
"documents": {}
},
{
"id": "864c80e3-ed59-44a5-ba07-7ee5ba547775",
"primary_email": "[email protected]",
"primary_phone": "+1987654321",
"legal_name": null,
"display_name": "Jane Doe",
"legal_number": null,
"tax_identification_number": null,
"logo_url": null,
"website_url": null,
"account_manager": null,
"first_name": "Jane",
"middle_name": "Marie",
"last_name": "Doe",
"full_name": "Jane Doe",
"billing_email": "[email protected]",
"timezone": "America/Los_Angeles",
"language": "en",
"currency": "USD",
"tax_status": "TAXABLE",
"address_line1": "123 Main Street",
"address_line2": "Apt 4B",
"city": "Los Angeles",
"state": "CA",
"country": "United States",
"zip_code": "90210",
"shipping_address_line1": null,
"shipping_address_line2": null,
"shipping_city": null,
"shipping_state": null,
"shipping_country": null,
"shipping_zip_code": null,
"created_at": "2025-08-22T14:20:30.123Z",
"updated_at": "2025-08-22T14:20:30.123Z",
"customer_type": "INDIVIDUAL",
"customer_key": "jane-doe-001",
"phone_numbers": [],
"email_addresses": [],
"billing_configuration": {},
"tax_identifications": [],
"contact_people": [],
"payment_terms": [],
"metadata": {},
"date_of_birth": "1985-06-15",
"documents": {}
}
]
}Retrieve all your customer details
import { init } from "metrifox-js";
const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});
// Get all customers with optional pagination
const response = await metrifoxClient.customers.list({
page: 1,
per_page: 25
});{
"statusCode": 200,
"message": "Customers fetched",
"meta": {
"current_page": 1,
"prev_page": null,
"next_page": null,
"per_page": 25,
"total_pages": 1,
"total_records": 2
},
"data": [
{
"id": "764c80e3-ed59-44a5-ba07-7ee5ba547774",
"primary_email": "[email protected]",
"primary_phone": "+1234567890",
"legal_name": "Acme Corporation",
"display_name": "Acme Corp",
"legal_number": null,
"tax_identification_number": null,
"logo_url": null,
"website_url": null,
"account_manager": null,
"first_name": null,
"middle_name": null,
"last_name": null,
"full_name": "Acme Corporation",
"billing_email": "[email protected]",
"timezone": "America/New_York",
"language": "en",
"currency": "USD",
"tax_status": "TAXABLE",
"address_line1": "123 Business Ave",
"address_line2": null,
"city": "New York",
"state": "NY",
"country": "United States",
"zip_code": "10001",
"shipping_address_line1": null,
"shipping_address_line2": null,
"shipping_city": null,
"shipping_state": null,
"shipping_country": null,
"shipping_zip_code": null,
"created_at": "2025-08-22T13:15:18.434Z",
"updated_at": "2025-08-22T13:15:18.434Z",
"customer_type": "BUSINESS",
"customer_key": "acme-corp-001",
"phone_numbers": [],
"email_addresses": [],
"billing_configuration": {},
"tax_identifications": [],
"contact_people": [],
"payment_terms": [],
"metadata": {},
"date_of_birth": null,
"documents": {}
},
{
"id": "864c80e3-ed59-44a5-ba07-7ee5ba547775",
"primary_email": "[email protected]",
"primary_phone": "+1987654321",
"legal_name": null,
"display_name": "Jane Doe",
"legal_number": null,
"tax_identification_number": null,
"logo_url": null,
"website_url": null,
"account_manager": null,
"first_name": "Jane",
"middle_name": "Marie",
"last_name": "Doe",
"full_name": "Jane Doe",
"billing_email": "[email protected]",
"timezone": "America/Los_Angeles",
"language": "en",
"currency": "USD",
"tax_status": "TAXABLE",
"address_line1": "123 Main Street",
"address_line2": "Apt 4B",
"city": "Los Angeles",
"state": "CA",
"country": "United States",
"zip_code": "90210",
"shipping_address_line1": null,
"shipping_address_line2": null,
"shipping_city": null,
"shipping_state": null,
"shipping_country": null,
"shipping_zip_code": null,
"created_at": "2025-08-22T14:20:30.123Z",
"updated_at": "2025-08-22T14:20:30.123Z",
"customer_type": "INDIVIDUAL",
"customer_key": "jane-doe-001",
"phone_numbers": [],
"email_addresses": [],
"billing_configuration": {},
"tax_identifications": [],
"contact_people": [],
"payment_terms": [],
"metadata": {},
"date_of_birth": "1985-06-15",
"documents": {}
}
]
}Customers fetched
200
"Customers fetched"
Show child attributes
Current page number
Previous page number (null if on first page)
Next page number (null if on last page)
Number of records per page
Total number of pages
Total number of records
Show child attributes
Unique customer identifier in the Metrifox system
Primary email address
Primary phone number
Legal business name
Display name for the business
Legal registration number
Tax identification number
URL to company logo
Company website URL
Assigned account manager
First name
Middle name
Last name
Full name
Email address for billing communications
Preferred timezone
Preferred language for communications
Preferred currency for billing
Tax status of the customer
TAXABLE, TAX_EXEMPT, REVERSE_CHARGE First line of address
Second line of address
City name
State or province
Country name
ZIP or postal code
First line of shipping address
Second line of shipping address
Shipping city name
Shipping state or province
Shipping country name
Shipping ZIP or postal code
Creation timestamp
Last update timestamp
Type of customer
BUSINESS, INDIVIDUAL Customer key if available
List of phone numbers
List of email addresses
Show child attributes
Preferred payment gateway
Preferred payment method
Email address for billing communications
Billing address
Number of days before payment reminder
Array of tax identification numbers
List of contact persons for the business
Show child attributes
First name of contact person
Last name of contact person
Email address of contact person
Job title or designation
Department name
Whether this is the primary contact person
Phone number for this contact person
Custom metadata
Date of birth (for individuals)
Attached documents
Whether to consolidate invoices mid-cycle