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>"
}
'import requests
url = "https://api-eu.flexportal.io/v1/customers/{customerId}"
payload = {
"customerId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"company": "<string>",
"phone": "<string>"
}
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Tenant-ID': '<tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerId: '<string>',
firstName: '<string>',
lastName: '<string>',
company: '<string>',
phone: '<string>'
})
};
fetch('https://api-eu.flexportal.io/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.flexportal.io/v1/customers/{customerId}",
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([
'customerId' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'company' => '<string>',
'phone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Tenant-ID: <tenant-id>"
],
]);
$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://api-eu.flexportal.io/v1/customers/{customerId}"
payload := strings.NewReader("{\n \"customerId\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
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://api-eu.flexportal.io/v1/customers/{customerId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/customers/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Customers
Update Customer
Updates customer details such as name, phone, or addresses.
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>"
}
'import requests
url = "https://api-eu.flexportal.io/v1/customers/{customerId}"
payload = {
"customerId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"company": "<string>",
"phone": "<string>"
}
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Tenant-ID': '<tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerId: '<string>',
firstName: '<string>',
lastName: '<string>',
company: '<string>',
phone: '<string>'
})
};
fetch('https://api-eu.flexportal.io/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.flexportal.io/v1/customers/{customerId}",
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([
'customerId' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'company' => '<string>',
'phone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Tenant-ID: <tenant-id>"
],
]);
$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://api-eu.flexportal.io/v1/customers/{customerId}"
payload := strings.NewReader("{\n \"customerId\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
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://api-eu.flexportal.io/v1/customers/{customerId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/customers/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}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
| Field | Description |
|---|---|
email | Customer email address |
firstName | First name |
lastName | Last name |
company | Company name |
phone | Phone number |
customerType | individual or business |
billingAddress | Billing address object |
shippingAddress | Shipping 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"
}
}
| Field | Required | Description |
|---|---|---|
contactName | Yes | Contact person at this address |
streetAddress | Yes | Street name and number |
city | Yes | City name |
country | Yes | Country name |
company | No | Company name |
buildingInfo | No | Building, floor, suite |
locality | No | Neighborhood or district |
adminArea | No | State or province |
postalCode | No | ZIP 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
| Change | Impact |
|---|---|
| Updates customer record; orders retain original email at time of order | |
| Address | Updates customer record; existing orders/subscriptions retain original addresses |
| Company | Updates display name; historical records unchanged |
Updates only affect the customer profile. Existing orders and subscriptions retain the information captured at the time of creation.
Related Endpoints
- Get Customer - View current customer details
- Delete Customer - Deactivate customer
- List Orders - View customer’s orders
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Path Parameters
The customer ID
Body
application/json
Minimum string length:
1Minimum string length:
1Minimum string length:
1Available options:
individual, business Available options:
active, inactive Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?