Skip to main content
PUT
/
v1
/
customers
/
{customerId}
Update a customer
curl --request PUT \
  --url https://api-eu.flexportal.io/v1/customers/{customerId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Tenant-ID: <tenant-id>' \
  --data '
{
  "customerId": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "company": "<string>",
  "phone": "<string>",
  "customerType": "individual",
  "status": "active",
  "billingAddress": {
    "contactName": "<string>",
    "streetAddress": "<string>",
    "city": "<string>",
    "country": "<string>",
    "company": "<string>",
    "buildingInfo": "<string>",
    "locality": "<string>",
    "adminArea": "<string>",
    "postalCode": "<string>"
  },
  "shippingAddress": {
    "contactName": "<string>",
    "streetAddress": "<string>",
    "city": "<string>",
    "country": "<string>",
    "company": "<string>",
    "buildingInfo": "<string>",
    "locality": "<string>",
    "adminArea": "<string>",
    "postalCode": "<string>"
  }
}
'
{
  "success": true,
  "message": "<string>",
  "customerId": "<string>",
  "customer": {
    "customerId": "<string>",
    "tenantId": "<string>",
    "email": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "customerType": "individual",
    "totalOrders": 123,
    "totalDevicesRented": 123,
    "totalMonthlyRevenue": 123,
    "status": "active",
    "orderIds": [
      "<string>"
    ],
    "rentalIds": [
      "<string>"
    ],
    "createdBy": "<string>",
    "company": "<string>",
    "phone": "<string>",
    "customFields": {},
    "lastBillingAddress": {
      "contactName": "<string>",
      "streetAddress": "<string>",
      "city": "<string>",
      "country": "<string>",
      "company": "<string>",
      "buildingInfo": "<string>",
      "locality": "<string>",
      "adminArea": "<string>",
      "postalCode": "<string>"
    },
    "lastShippingAddress": {
      "contactName": "<string>",
      "streetAddress": "<string>",
      "city": "<string>",
      "country": "<string>",
      "company": "<string>",
      "buildingInfo": "<string>",
      "locality": "<string>",
      "adminArea": "<string>",
      "postalCode": "<string>"
    },
    "createdAt": "<unknown>",
    "updatedAt": "<unknown>",
    "lifetimeCollected": 123,
    "totalAcquisitionCost": 123,
    "customerMargin": 123,
    "customerMarginPercent": 123,
    "subscriptionsTracked": 123
  }
}

Overview

Update a customer’s profile information, contact details, or addresses. Use this endpoint to keep customer data current or to correct information after initial order creation.

Common Use Cases

  • Profile Updates: Customer changed their phone number or email
  • Company Changes: Customer switched jobs or company renamed
  • Address Updates: Customer moved to a new location
  • Data Correction: Fix typos or errors from initial order entry
  • CRM Sync: Update customer data from external systems

Updatable Fields

FieldDescription
emailCustomer email address
firstNameFirst name
lastNameLast name
companyCompany name
phonePhone number
customerTypeindividual or business
billingAddressBilling address object
shippingAddressShipping address object

Partial Updates

Only include fields you want to change:
{
  "phone": "+31612345678",
  "company": "New Company Name"
}

Updating Addresses

Update billing or shipping addresses:
{
  "billingAddress": {
    "contactName": "Finance Department",
    "company": "Acme Corporation",
    "streetAddress": "789 New Street",
    "city": "Utrecht",
    "postalCode": "3500 AA",
    "country": "Netherlands"
  }
}
Address fields:
FieldRequiredDescription
contactNameYesContact person at this address
streetAddressYesStreet name and number
cityYesCity name
countryYesCountry name
companyNoCompany name
buildingInfoNoBuilding, floor, suite
localityNoNeighborhood or district
adminAreaNoState or province
postalCodeNoZIP or postal code

Example: Update Contact Information

await updateCustomer('cust_abc123', {
  phone: '+31687654321',
  email: 'newemail@company.com'
});

Example: Update for Company Merger

// Customer's company was acquired
await updateCustomer('cust_abc123', {
  company: 'Acquiring Company B.V.',
  billingAddress: {
    contactName: 'Finance Department',
    company: 'Acquiring Company B.V.',
    streetAddress: '100 Corporate Plaza',
    city: 'Amsterdam',
    postalCode: '1000 AA',
    country: 'Netherlands'
  }
});

Changing Customer Type

Convert between individual and business:
{
  "customerType": "business",
  "company": "New Business LLC"
}
Changing customer type to business enables features like billing groups for consolidated invoicing.

Impact on Existing Data

ChangeImpact
EmailUpdates customer record; orders retain original email at time of order
AddressUpdates customer record; existing orders/subscriptions retain original addresses
CompanyUpdates display name; historical records unchanged
Updates only affect the customer profile. Existing orders and subscriptions retain the information captured at the time of creation.

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Path Parameters

customerId
string
required

The customer ID

Body

application/json
customerId
string
required
Minimum string length: 1
firstName
string
Minimum string length: 1
lastName
string
Minimum string length: 1
company
string
phone
string
customerType
enum<string>
Available options:
individual,
business
status
enum<string>
Available options:
active,
inactive
billingAddress
object
shippingAddress
object

Response

Customer updated

success
enum<boolean>
required
Available options:
true,
false
message
string
required
customerId
string
required
customer
object
required