from metrifox_sdk import MetrifoxClient
client = MetrifoxClient(api_key="your_api_key")
# Update a customer
customer_key = "customer_unique_key"
update_data = {
"primary_email": "newemail@example.com",
"display_name": "Updated Name"
# Refer to request schema for all available fields
}
response = client.customers.update(customer_key, update_data)
import { init } from "metrifox-js";
const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});
// Update a customer
const customerKey = 'customer_unique_key';
const updateData = {
// customer update data - refer to request schema for all available fields
};
const response = await metrifoxClient.customers.update(customerKey, updateData);
require 'metrifox-sdk'
# Initialize with configuration
METRIFOX_SDK = MetrifoxSDK.init({ api_key: "your-api-key" })
# Update a customer
const customerKey = 'customer_unique_key';
update_data = {
# customer update data - refer to request schema for all available fields
}
response = METRIFOX_SDK.customers.update(customer_key, update_data)
curl --request PUT \
--url https://{defaultHost}/api/v1/customers/{customer_key} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"primary_email": "new-contact@acme.com",
"billing_email": "billing@acme.com"
}
'<?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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'primary_email' => 'new-contact@acme.com',
'billing_email' => 'billing@acme.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/api/v1/customers/{customer_key}"
payload := strings.NewReader("{\n \"primary_email\": \"new-contact@acme.com\",\n \"billing_email\": \"billing@acme.com\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{defaultHost}/api/v1/customers/{customer_key}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"primary_email\": \"new-contact@acme.com\",\n \"billing_email\": \"billing@acme.com\"\n}")
.asString();{
"message": "Customer updated",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_email": "jsmith@example.com",
"primary_phone": "<string>",
"legal_name": "<string>",
"display_name": "<string>",
"legal_number": "<string>",
"tax_identification_number": "<string>",
"logo_url": "<string>",
"website_url": "<string>",
"account_manager": "<string>",
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"billing_email": "jsmith@example.com",
"timezone": "<string>",
"language": "<string>",
"currency": "<string>",
"tax_status": "TAXABLE",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zip_code": "<string>",
"shipping_address_line1": "<string>",
"shipping_address_line2": "<string>",
"shipping_city": "<string>",
"shipping_state": "<string>",
"shipping_country": "<string>",
"shipping_zip_code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"customer_type": "BUSINESS",
"customer_key": "<string>",
"phone_numbers": [
{}
],
"email_addresses": [
{}
],
"billing_configuration": {
"preferred_payment_gateway": "<string>",
"preferred_payment_method": "<string>",
"billing_email": "jsmith@example.com",
"billing_address": "<string>",
"payment_reminder_days": 123
},
"tax_identifications": [
{
"type": "<string>",
"number": "<string>",
"country": "<string>"
}
],
"contact_people": [
{
"first_name": "<string>",
"last_name": "<string>",
"email_address": "jsmith@example.com",
"designation": "<string>",
"department": "<string>",
"is_primary": false,
"phone_number": "<string>"
}
],
"payment_terms": [
{
"type": "<string>",
"value": "<string>"
}
],
"metadata": {},
"date_of_birth": "2023-12-25",
"documents": {},
"mid_cycle_invoice_consolidation": true
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Update Customer
Update an existing customer
from metrifox_sdk import MetrifoxClient
client = MetrifoxClient(api_key="your_api_key")
# Update a customer
customer_key = "customer_unique_key"
update_data = {
"primary_email": "newemail@example.com",
"display_name": "Updated Name"
# Refer to request schema for all available fields
}
response = client.customers.update(customer_key, update_data)
import { init } from "metrifox-js";
const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});
// Update a customer
const customerKey = 'customer_unique_key';
const updateData = {
// customer update data - refer to request schema for all available fields
};
const response = await metrifoxClient.customers.update(customerKey, updateData);
require 'metrifox-sdk'
# Initialize with configuration
METRIFOX_SDK = MetrifoxSDK.init({ api_key: "your-api-key" })
# Update a customer
const customerKey = 'customer_unique_key';
update_data = {
# customer update data - refer to request schema for all available fields
}
response = METRIFOX_SDK.customers.update(customer_key, update_data)
curl --request PUT \
--url https://{defaultHost}/api/v1/customers/{customer_key} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"primary_email": "new-contact@acme.com",
"billing_email": "billing@acme.com"
}
'<?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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'primary_email' => 'new-contact@acme.com',
'billing_email' => 'billing@acme.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/api/v1/customers/{customer_key}"
payload := strings.NewReader("{\n \"primary_email\": \"new-contact@acme.com\",\n \"billing_email\": \"billing@acme.com\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{defaultHost}/api/v1/customers/{customer_key}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"primary_email\": \"new-contact@acme.com\",\n \"billing_email\": \"billing@acme.com\"\n}")
.asString();{
"message": "Customer updated",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_email": "jsmith@example.com",
"primary_phone": "<string>",
"legal_name": "<string>",
"display_name": "<string>",
"legal_number": "<string>",
"tax_identification_number": "<string>",
"logo_url": "<string>",
"website_url": "<string>",
"account_manager": "<string>",
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"billing_email": "jsmith@example.com",
"timezone": "<string>",
"language": "<string>",
"currency": "<string>",
"tax_status": "TAXABLE",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zip_code": "<string>",
"shipping_address_line1": "<string>",
"shipping_address_line2": "<string>",
"shipping_city": "<string>",
"shipping_state": "<string>",
"shipping_country": "<string>",
"shipping_zip_code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"customer_type": "BUSINESS",
"customer_key": "<string>",
"phone_numbers": [
{}
],
"email_addresses": [
{}
],
"billing_configuration": {
"preferred_payment_gateway": "<string>",
"preferred_payment_method": "<string>",
"billing_email": "jsmith@example.com",
"billing_address": "<string>",
"payment_reminder_days": 123
},
"tax_identifications": [
{
"type": "<string>",
"number": "<string>",
"country": "<string>"
}
],
"contact_people": [
{
"first_name": "<string>",
"last_name": "<string>",
"email_address": "jsmith@example.com",
"designation": "<string>",
"department": "<string>",
"is_primary": false,
"phone_number": "<string>"
}
],
"payment_terms": [
{
"type": "<string>",
"value": "<string>"
}
],
"metadata": {},
"date_of_birth": "2023-12-25",
"documents": {},
"mid_cycle_invoice_consolidation": true
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Authorizations
Path Parameters
Unique identifier of the customer in your application to update
Body
Primary email address for the customer
Primary phone number for the customer
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
Date of birth (for individuals)
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
Show child attributes
Show child attributes
Array of tax identification numbers
Show child attributes
Show child attributes
List of contact persons for the business
Show child attributes
Show child attributes
Payment terms configuration
Show child attributes
Show child attributes
Custom metadata
List of additional email addresses
Show child attributes
Show child attributes
List of additional phone numbers
Show child attributes
Show child attributes
Optional documents to attach to the customer

