Python SDK
from metrifox_sdk import MetrifoxClient
client = MetrifoxClient(api_key="your_api_key")
# Get a customer by key
customer_key = "acme-corp-001"
response = client.customers.get(customer_key)
import { init } from "metrifox-js";
const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});
// Get a customer by key
const customerKey = "acme-corp-001";
const response = await metrifoxClient.customers.get(customerKey);
require 'metrifox-sdk'
# Initialize with configuration
METRIFOX_SDK = MetrifoxSDK.init({ api_key: "your-api-key" })
# Get a customer by key
response = METRIFOX_SDK.customers.get_customer({ customer_key: "acme-corp-001" })
curl --request GET \
--url https://{defaultHost}/api/v1/customers/{customer_key} \
--header 'x-api-key: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/api/v1/customers/{customer_key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/api/v1/customers/{customer_key}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{defaultHost}/api/v1/customers/{customer_key}")
.header("x-api-key", "<api-key>")
.asString();{
"message": "Customer fetched",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"primary_email": "contact@acme.com",
"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": "billing@acme.com",
"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": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"customer_type": "BUSINESS",
"customer_key": "acme-corp-001",
"phone_numbers": [],
"email_addresses": [
{
"email": "contact@acme.com",
"is_primary": true
}
],
"billing_configuration": {},
"tax_identifications": [],
"contact_people": [],
"payment_terms": [],
"metadata": {},
"date_of_birth": null,
"documents": {},
"mid_cycle_invoice_consolidation": false
}
}{
"message": "<string>",
"errors": {}
}{
"message": "Customer not found"
}Customers
Get One Customer
Retrieve the details of one customer
GET
/
api
/
v1
/
customers
/
{customer_key}
Python SDK
from metrifox_sdk import MetrifoxClient
client = MetrifoxClient(api_key="your_api_key")
# Get a customer by key
customer_key = "acme-corp-001"
response = client.customers.get(customer_key)
import { init } from "metrifox-js";
const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});
// Get a customer by key
const customerKey = "acme-corp-001";
const response = await metrifoxClient.customers.get(customerKey);
require 'metrifox-sdk'
# Initialize with configuration
METRIFOX_SDK = MetrifoxSDK.init({ api_key: "your-api-key" })
# Get a customer by key
response = METRIFOX_SDK.customers.get_customer({ customer_key: "acme-corp-001" })
curl --request GET \
--url https://{defaultHost}/api/v1/customers/{customer_key} \
--header 'x-api-key: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/api/v1/customers/{customer_key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/api/v1/customers/{customer_key}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{defaultHost}/api/v1/customers/{customer_key}")
.header("x-api-key", "<api-key>")
.asString();{
"message": "Customer fetched",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"primary_email": "contact@acme.com",
"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": "billing@acme.com",
"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": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"customer_type": "BUSINESS",
"customer_key": "acme-corp-001",
"phone_numbers": [],
"email_addresses": [
{
"email": "contact@acme.com",
"is_primary": true
}
],
"billing_configuration": {},
"tax_identifications": [],
"contact_people": [],
"payment_terms": [],
"metadata": {},
"date_of_birth": null,
"documents": {},
"mid_cycle_invoice_consolidation": false
}
}{
"message": "<string>",
"errors": {}
}{
"message": "Customer not found"
}⌘I

