List customers
curl --request GET \
--url https://api-eu.flexportal.io/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/customers"
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', 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",
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"
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")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/customers")
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{
"customers": [
{
"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
}
],
"count": 123,
"limit": 123,
"hasMore": true,
"nextCursor": "<string>"
}Customers
List Customers
Returns a paginated list of customers.
GET
/
v1
/
customers
List customers
curl --request GET \
--url https://api-eu.flexportal.io/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/customers"
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', 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",
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"
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")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/customers")
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{
"customers": [
{
"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
}
],
"count": 123,
"limit": 123,
"hasMore": true,
"nextCursor": "<string>"
}Overview
Retrieve a paginated list of customers with optional filtering and sorting. Customers are automatically created when orders are placed—you don’t need to create them separately.Customer Creation
Customers are created automatically when:- An order is placed with a new email address
- The system creates a customer record linked to that email
Common Use Cases
Customer Directory
Build customer management interfaces for your support or sales teams
CRM Integration
Sync customer data to external CRM systems like Salesforce or HubSpot
Reporting
Generate customer reports, segment customers, or analyze customer base
Support Lookup
Find customers by email or name to assist with support inquiries
Filtering Customers
# Get active customers
GET /v1/customers?status=active
# Find customer by email
GET /v1/customers?email=john@example.com
# Get business customers only
GET /v1/customers?customerType=business
# Get customers with active subscriptions
GET /v1/customers?hasActiveRentals=true
# Combine filters
GET /v1/customers?status=active&customerType=business&hasActiveRentals=true
Sorting Options
| Field | Description |
|---|---|
createdAt | Customer creation date (default) |
firstName | First name alphabetically |
lastName | Last name alphabetically |
email | Email address alphabetically |
totalMonthlyRevenue | Current monthly revenue from this customer |
totalDevicesRented | Number of active subscriptions |
# Sort by highest revenue customers
GET /v1/customers?sortBy=totalMonthlyRevenue&sortDir=desc
# Sort by most recent customers
GET /v1/customers?sortBy=createdAt&sortDir=desc
Response Fields
Key fields in each customer object:| Field | Description |
|---|---|
customerId | Unique customer identifier |
email | Customer email address |
firstName | First name |
lastName | Last name |
company | Company name (for business customers) |
phone | Phone number |
customerType | individual or business |
status | active or inactive |
totalDevicesRented | Number of active subscriptions |
totalMonthlyRevenue | Current MRR from this customer |
createdAt | ISO 8601 timestamp |
Example: Find High-Value Customers
// Get top 10 customers by monthly revenue
const { customers } = await listCustomers({
status: 'active',
hasActiveRentals: true,
sortBy: 'totalMonthlyRevenue',
sortDir: 'desc',
limit: 10
});
for (const customer of customers) {
console.log(`${customer.firstName} ${customer.lastName}: €${customer.totalMonthlyRevenue}/mo`);
}
Related Endpoints
- Get Customer - Retrieve customer with profitability metrics
- Update Customer - Modify customer details
- List Orders - View customer’s orders
- List Subscriptions - View customer’s subscriptions
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Query Parameters
Items per page (default: 50, max: 100)
Cursor for pagination
Filter by status (active, inactive)
Filter by type (individual, business)
Filter by exact email match
Was this page helpful?