Skip to main content
PUT
/
api
/
v1
/
customers
/
{customer_key}
Javascript SDK
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);
{
  "message": "Customer updated",
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "primary_email": "[email protected]",
    "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": "[email protected]",
    "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": "[email protected]",
      "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": "[email protected]",
        "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
  }
}
Important: Customer keys are immutable and cannot be changed once created. Only customer attributes can be updated, not the customer key itself.

Authorizations

x-api-key
string
header
required

Path Parameters

customer_key
string
required

Unique identifier of the customer in your application to update

Body

application/json
primary_email
string<email>

Primary email address for the customer

primary_phone
string

Primary phone number for the customer

Legal business name

display_name
string

Display name for the business

Legal registration number

tax_identification_number
string

Tax identification number

logo_url
string<uri>

URL to company logo

website_url
string<uri>

Company website URL

account_manager
string

Assigned account manager

first_name
string

First name

middle_name
string

Middle name

last_name
string

Last name

date_of_birth
string<date>

Date of birth (for individuals)

billing_email
string<email>

Email address for billing communications

timezone
string

Preferred timezone

language
string

Preferred language for communications

currency
string

Preferred currency for billing

tax_status
enum<string>

Tax status of the customer

Available options:
TAXABLE,
TAX_EXEMPT,
REVERSE_CHARGE
address_line1
string

First line of address

address_line2
string

Second line of address

city
string

City name

state
string

State or province

country
string

Country name

zip_code
string

ZIP or postal code

shipping_address_line1
string

First line of shipping address

shipping_address_line2
string

Second line of shipping address

shipping_city
string

Shipping city name

shipping_state
string

Shipping state or province

shipping_country
string

Shipping country name

shipping_zip_code
string

Shipping ZIP or postal code

billing_configuration
object
tax_identifications
object[]

Array of tax identification numbers

contact_people
object[]

List of contact persons for the business

payment_terms
object[]

Payment terms configuration

metadata
object

Custom metadata

email_addresses
object[]

List of additional email addresses

phone_numbers
object[]

List of additional phone numbers

documents
object

Optional documents to attach to the customer

Response

Customer updated successfully

message
string
Example:

"Customer updated"

data
object