Get a customer
curl --request GET \
--url https://api-eu.flexportal.io/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/customers/{customerId}"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/customers/{customerId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-eu.flexportal.io/v1/customers/{customerId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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
Get Customer
Retrieves a specific customer by ID.
GET
/
v1
/
customers
/
{customerId}
Get a customer
curl --request GET \
--url https://api-eu.flexportal.io/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/customers/{customerId}"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/customers/{customerId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-eu.flexportal.io/v1/customers/{customerId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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
Retrieve complete details for a single customer, including profitability metrics and subscription summary. Use this endpoint for customer detail pages, support lookups, or profitability analysis.Common Use Cases
- Customer Profile Page: Display complete customer information and subscription history
- Support Lookup: Quickly find customer details during support calls
- Profitability Analysis: Review customer lifetime value and cost recovery metrics
- Pre-Order Check: Verify customer details before processing new orders
Profitability Metrics
The customer response includes valuable profitability data:{
"profitability": {
"lifetimeCollected": 4250.00,
"totalAcquisitionCost": 3600.00,
"costRecoveryPercent": 118.05,
"averageMonthlyRevenue": 354.17,
"totalDevicesEver": 3,
"activeDevices": 2
}
}
| Metric | Description |
|---|---|
lifetimeCollected | Total payments collected from this customer |
totalAcquisitionCost | Total cost of assets provided to customer |
costRecoveryPercent | (Collected / Cost) × 100—shows overall profitability |
averageMonthlyRevenue | Average monthly revenue from this customer |
totalDevicesEver | Total devices ever subscribed |
activeDevices | Currently active subscriptions |
Customer Types
| Type | Description | Typical Use |
|---|---|---|
individual | Personal customer | Consumer subscriptions |
business | Business customer | B2B subscriptions, often with billing groups |
Address Information
Customer records include billing and shipping addresses:{
"billingAddress": {
"contactName": "John Smith",
"streetAddress": "123 Main Street",
"city": "Amsterdam",
"postalCode": "1012 AB",
"country": "Netherlands"
},
"shippingAddress": {
"contactName": "John Smith",
"company": "Acme Corp",
"streetAddress": "456 Office Park",
"city": "Rotterdam",
"postalCode": "3011 AA",
"country": "Netherlands"
}
}
Example: Customer Summary for Support
async function getCustomerSummary(customerId) {
const customer = await getCustomer(customerId);
return {
name: `${customer.firstName} ${customer.lastName}`,
email: customer.email,
company: customer.company || 'Individual',
activeSubscriptions: customer.profitability.activeDevices,
monthlyRevenue: customer.profitability.averageMonthlyRevenue,
lifetimeValue: customer.profitability.lifetimeCollected,
isProfitable: customer.profitability.costRecoveryPercent >= 100
};
}
Example: Check Customer Eligibility
async function canCustomerUpgrade(customerId) {
const customer = await getCustomer(customerId);
// Business logic: Only allow upgrades for customers in good standing
const hasActiveSubscriptions = customer.profitability.activeDevices > 0;
const isActive = customer.status === 'active';
return hasActiveSubscriptions && isActive;
}
Related Endpoints
- List Customers - Browse all customers
- Update Customer - Modify customer details
- List Subscriptions - Get customer’s subscriptions
- List Orders - Get customer’s order history
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Path Parameters
The customer ID
Response
Customer details
Available options:
individual, business Available options:
active, inactive Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?